.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Check if Door is Anchored to Wall

1 REPLY 1
Reply
Message 1 of 2
ChrisPicklesimer
340 Views, 1 Reply

Check if Door is Anchored to Wall

(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

 

1 REPLY 1
Message 2 of 2

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost