Community
(ACA 2010)
I would like to test to see if a selected door is anchored to a selected wall. From the code below I aquire the objectIDs of a wall and door using a GetEntity sub. I then attempt to get an anchor from the door anchorID but am not sure where to go from here.
In VBA I was able to: Anchor = objDoor.GetAnchor and then check the Anchor.Reference.Handle to see if it was the same as the wall handle in question.
Thanks.
Chris
Dim pt As Point3d Dim WobjID As ObjectId = GetEntityID(pt) 'Wall ObjectID Dim DobjID As ObjectId = GetEntityID(pt) 'Door ObjectID Dim db As Autodesk.AutoCAD.DatabaseServices.Database = Autodesk.AutoCAD.DatabaseServices.HostApplicationServices.WorkingDatabase Using tr As Transaction = db.TransactionManager.StartTransaction() Dim Went As Entity = tr.GetObject(WobjID, OpenMode.ForRead) Dim Dent As Door = tr.GetObject(DobjID, OpenMode.ForRead) Dim Anchor As AnchorOpeningBaseToWall = tr.GetObject Dent.AnchorId, OpenMode.ForRead) End Using
I searched the object browser (again) and found a CurveID property.
It appears if ...
Went.ObjectId = myAnchor.CurveId
...then the selected door is anchored to the wall inquestion.
cp