ccaadd 发表于 2006-4-28 09:39:00

修改acad m 2006标准件数据

<P>修改引用件程序如下,给各位也分享一下:</P>
<P>&nbsp;&nbsp;&nbsp; Dim acadapp As AcadApplication<BR>&nbsp;&nbsp;&nbsp; Dim mcadApp As McadApplication<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Dim idoc As IAcadDocument<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set acadapp = GetObject(, "AUTOCAD.Application.16")<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set mcadApp = acadapp.GetInterfaceObject("Mcad.Application")<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set idoc = acadapp.ActiveDocument<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Dim mpartref As McadPartReference<BR>&nbsp;&nbsp;&nbsp; Set mpartref = idoc.ModelSpace.Item(4)&nbsp; '此处取到一个引用件mcadpartref对象</P>
<P>&nbsp;&nbsp;&nbsp; Dim symbb As McadSymbolBBMgr<BR>&nbsp;&nbsp;&nbsp; Set symbb = acadapp.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")</P>
<P>&nbsp;&nbsp;&nbsp; Dim bommgr As McadBOMMgr<BR>&nbsp;&nbsp;&nbsp; Set bommgr = symbb.bommgr</P>
<P>&nbsp;&nbsp;&nbsp; Dim pdata() As String</P>
<P>&nbsp;&nbsp;&nbsp; pdata = mpartref .Data</P>
<P>&nbsp;&nbsp;&nbsp; pdata(0, 1) = "aaaa"<BR>&nbsp;&nbsp;&nbsp; pdata(1, 1) = "bbbbbb"</P>
<P>&nbsp;&nbsp;&nbsp; 。。。。</P>
<P>&nbsp;&nbsp;&nbsp; bommgr.SetPartData mbom, pdata<BR>&nbsp;&nbsp;&nbsp; acadapp.Update</P>
<P>哪位高手有修改标准件数据的方法吗?联系MSN: <A href="mailto:hellilu@gmail.com" target="_blank" >hellilu@gmail.com</A>,,谢谢</P>
页: [1]
查看完整版本: 修改acad m 2006标准件数据