ped123 发表于 2006-1-4 20:31:00

[ARX]请高手们指点一下

<P>如果知道两点坐标</P>
<P>用ARX如何实现尺寸标注?可以的话给个程序段源码。</P>
<P>在线等,请高手们指点</P>
<P>另外,我下面的函数写出的字体的宽度系数和设置的宽度系数不一致,其他没问题</P>
<P>请帮忙看一下,哪里有问题,谢谢!</P>
<P>Acad::ErrorStatus es;<BR>&nbsp; AcDbTextStyleTable *pTsTable;</P>
<P>&nbsp; es = curDoc()-&gt;database()-&gt;getSymbolTable(pTsTable,AcDb::kForRead);<BR>&nbsp; if (es != Acad::eOk)<BR>&nbsp; {<BR>&nbsp;&nbsp; AfxMessageBox("Couldn't get the text style table.");<BR>&nbsp; }</P>
<P>&nbsp; CString theFont = "宋体";</P>
<P>&nbsp; if (!pTsTable-&gt;has((LPTSTR)(LPCSTR)theFont))<BR>&nbsp; {<BR>&nbsp;&nbsp; AcDbTextStyleTableRecord *pStyle = new AcDbTextStyleTableRecord;</P>
<P>&nbsp;&nbsp; pStyle-&gt;setFont((LPTSTR)(LPCTSTR)theFont,Adesk::kFalse,Adesk::kFalse,0,34);<BR>&nbsp;&nbsp; pStyle-&gt;setFileName(theFont);<BR>&nbsp;&nbsp; pStyle-&gt;setBigFontFileName(theFont);</P>
<P>&nbsp;&nbsp; pStyle-&gt;setTextSize(8);<BR>&nbsp;&nbsp; pStyle-&gt;setXScale(0.3);<BR>&nbsp;&nbsp; pStyle-&gt;setObliquingAngle(0);<BR>&nbsp;&nbsp; pStyle-&gt;setName(theFont);<BR>&nbsp;&nbsp; pStyle-&gt;setIsShapeFile(Adesk::kFalse);<BR>&nbsp;&nbsp; pStyle-&gt;setIsVertical(Adesk::kFalse);</P>
<P>&nbsp;&nbsp; pTsTable-&gt;upgradeOpen();<BR>&nbsp;&nbsp; es = pTsTable-&gt;add(pStyle);<BR>&nbsp;&nbsp; if (es != Acad::eOk)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; CString message;<BR>&nbsp;&nbsp;&nbsp; message.Format("%d",es);<BR>&nbsp;&nbsp;&nbsp; AfxMessageBox(message);<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; pStyle-&gt;close();<BR>&nbsp; }</P>
<P>&nbsp; AcDbObjectId styleId;</P>
<P>&nbsp; es = pTsTable-&gt;getAt(theFont,styleId);<BR>&nbsp; if (es != Acad::eOk)<BR>&nbsp; {<BR>&nbsp;&nbsp; CString message;<BR>&nbsp;&nbsp; message.Format("%d",es);<BR>&nbsp;&nbsp; AfxMessageBox(message);<BR>&nbsp; }</P>
<P><BR>&nbsp; pTsTable-&gt;close();<BR>&nbsp; </P>
<P>&nbsp; AcDbText * text = new AcDbText(AcGePoint3d(10,10,0),"你好",styleId,8,0);<BR>&nbsp; AcDbBlockTable *pBlockTable;<BR>&nbsp; acdbHostApplicationServices()-&gt;workingDatabase()-&gt;getSymbolTable(pBlockTable,AcDb::kForRead);<BR>&nbsp; AcDbBlockTableRecord *pBlockTableRecord;<BR>&nbsp; pBlockTable-&gt;getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);<BR>&nbsp; pBlockTable-&gt;close();<BR>&nbsp; AcDbObjectId textId;<BR>&nbsp; es = pBlockTableRecord-&gt;appendAcDbEntity(textId,text);<BR>&nbsp; <BR>&nbsp; text-&gt;close();<BR>&nbsp; pBlockTableRecord-&gt;close();</P>

kswzc 发表于 2006-1-5 12:09:00

<P class=MsoNormal style="TEXT-ALIGN: left" align=left>AcDb3PointAngularDimension::AcDb3PointAngularDimension 函数 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>AcDb3PointAngularDimension(<o:p></o:p></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>const AcGePoint3d&amp; <SPAN class=SpellE>centerPoint,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>const AcGePoint3d&amp; xLine1Point,<o:p></o:p></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>const AcGePoint3d&amp; xLine2Point,<o:p></o:p></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>const AcGePoint3d&amp; <SPAN class=SpellE>arcPoint,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>const char* <SPAN class=SpellE>dimText = NULL,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">AcDbObjectId</SPAN> <SPAN class=SpellE>dimStyle = AcDbObjectId::kNull);<o:p></o:p></SPAN></P>
<TABLE class=a style="mso-cellspacing: 1.5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellPadding=0 border=0>
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">centerPoint</SPAN><o:p></o:p></P></TD>
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>输入被<FONT style="BACKGROUND-COLOR: #316ac5" color=#ffffff>标注</FONT>的角度的中点(顶点)(在<SPAN lang=EN-US>WCS中)<o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 1">
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>xLine1Point<o:p></o:p></P></TD>
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>输入第一条界线的开始点(在<SPAN lang=EN-US>WCS中)<o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 2">
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>xLine2Point<o:p></o:p></P></TD>
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>输入第二条界线的开始点(在<SPAN lang=EN-US>WCS中)<o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 3">
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">arcPoint</SPAN><o:p></o:p></P></TD>
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>输入将在<FONT style="BACKGROUND-COLOR: #316ac5" color=#ffffff>标注</FONT>弧上的一个点<SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 4">
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">dimText</SPAN><o:p></o:p></P></TD>
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>输入作为<FONT style="BACKGROUND-COLOR: #316ac5" color=#ffffff>标注</FONT>文本的文本字符串<SPAN lang=EN-US><o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 5; mso-yfti-lastrow: yes">
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><SPAN lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">dimStyle</SPAN><o:p></o:p></P></TD>
<TD style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt" vAlign=top>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left>输入要使用的<SPAN class=SpellE><SPAN lang=EN-US>AcDbDimStyleTableRecord</SPAN>的对象ID<o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE>
页: [1]
查看完整版本: [ARX]请高手们指点一下