[求助] 修改CAD2006机械版部件数据
<INPUT class=btn style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体" onclick="text1.style.fontSize='12pt';" type=button value=12号字> <OPTION value="9pt">9pt</OPTION> <OPTION value="10pt" selected>10pt</OPTION> <OPTION value="11pt">11pt</OPTION> <OPTION value="12pt">12pt</OPTION> <OPTION value="13pt">13pt</OPTION> <OPTION value="15pt">15pt</OPTION><P><FONT id=text1 style="FONT-SIZE: 10pt" face="宋体,verdana, arial, helvetica"><BR>我使用autocad2006 type lib、autodesk mcadauto2.0 type lib 和 autodesk symbbauto2.0 type lib, 可以修改bom序号和数量,但是修改不了部件的数据,请高手介绍一种方法,用arx也行,拜谢!!!<BR><BR>vb修改程序如下:<BR>Dim acadApp As acadApplication<BR>Dim mcadApp As McadApplication<BR><BR>Dim idoc As IMcadDocument<BR>Dim ibom As IMcadBOMItem<BR><BR>Set acadApp = GetObject(, "AUTOCAD.Application.16")<BR>Set mcadApp = acadApp.GetInterfaceObject("Mcad.Application")<BR><BR>Set idoc = mcadApp.ActiveDocument<BR>Dim mpart As IMcadPartList<BR><BR>Set mpart = idoc.HostDocument.ModelSpace.Item(13) '此处取得IMcadPartList对象<BR><BR>'修改bom序号和数量<BR>mpart.ItemList(3).Quantity = 88<BR>mpart.ItemList(3).ItemNumber = "33"<BR>mpart.Update<BR><BR>'修改部件数据<BR>mpart.ItemList(3).Data(1, 1) = "dsfsf" '此处取一个部件属性进行修改,无效???<BR>mpart.Update</FONT> </P>
<P>还有如何获取mbomstandard对象, 有一个addcolum方法可能可以增加一个部件信息.</P> <P>哪位高手有修改标准件数据的方法吗?——求助</P>
<P>修改引用件程序如下,给各位也分享一下:</P>
<P> Dim acadapp As AcadApplication<BR> Dim mcadApp As McadApplication<BR> <BR> Dim idoc As IAcadDocument<BR> <BR> <BR> Set acadapp = GetObject(, "AUTOCAD.Application.16")<BR> <BR> Set mcadApp = acadapp.GetInterfaceObject("Mcad.Application")<BR> <BR> Set idoc = acadapp.ActiveDocument<BR> <BR> Dim mpartref As McadPartReference<BR> Set mpartref = idoc.ModelSpace.Item(4) '此处取到一个引用件mcadpartref对象</P>
<P> Dim symbb As McadSymbolBBMgr<BR> Set symbb = acadapp.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")</P>
<P> Dim bommgr As McadBOMMgr<BR> Set bommgr = symbb.bommgr</P>
<P> Dim pdata() As String</P>
<P> pdata = mpartref .Data</P>
<P> pdata(0, 1) = "aaaa"<BR> pdata(1, 1) = "bbbbbb"</P>
<P> 。。。。</P>
<P> bommgr.SetPartData mbom, pdata<BR> acadapp.Update</P>
<P>联系MSN: <A href="mailto:hellilu@gmail.com" target="_blank" ><FONT color=#000000>hellilu@gmail.com</FONT></A>,,谢谢</P>
页:
[1]