Community
Hello,
I need to get the position and boundig box of the table "bill of materials". Any idea?
Public Shared Sub GetPosicionBOM() Dim acadApp As AcadApplication = Nothing Dim symMgr As McadSymbolBBMgr = Nothing Dim symBOMs As McadBOMs = Nothing acadApp = DirectCast(Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication, AcadApplication) symMgr = acadApp.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr") symBOMs = symMgr.BOMMgr.GetAllBOMTables(True) If symBOMs IsNot Nothing AndAlso symBOMs.Count > 0 Then For Each symBOM As McadBOM In symBOMs ' I neet to get the position and bounding box of the object symBOM Next End If acadApp = Nothing symMgr = Nothing symBOMs = Nothing End Sub
thansk,
Ane
Solved! Go to Solution.
Finally I found the solution;
<CommandMethod("PartListBoundingBox")> _ Public Sub PartListBoundingBox() Dim doc As Document = Application.DocumentManager.MdiActiveDocument Dim bt As BlockTable = Nothing Dim btr As BlockTableRecord = Nothing Dim objId As ObjectId = Nothing Dim partList As Entity = Nothing Using tr As Transaction = doc.TransactionManager.StartTransaction bt = DirectCast(tr.GetObject(doc.Database.BlockTableId, OpenMode.ForRead), BlockTable) btr = DirectCast(tr.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForRead), BlockTableRecord) If btr IsNot Nothing Then For Each objId In btr If objId.ObjectClass.DxfName.ToUpper = "ACMPARTLIST" Then partList = tr.GetObject(objId, OpenMode.ForRead) If partList.Bounds.HasValue Then MsgBox("MinPoint (" & partList.Bounds.Value.MinPoint(0).ToString & "," & partList.Bounds.Value.MinPoint(1) & ")" & Chr(13) & _ "MaxPoint (" & partList.Bounds.Value.MaxPoint(0).ToString & "," & partList.Bounds.Value.MaxPoint(1) & ")") Exit For End If End If Next End If tr.Commit() End Using End Sub