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

Accessing AEC Wall Style Components

5 REPLIES 5
Reply
Message 1 of 6
ChrisPicklesimer
616 Views, 5 Replies

Accessing AEC Wall Style Components

I would like to get wall component info (location & size) of a wall style.  Is this possible?    Could anyone give me a nudge in the right direction?

 

Thanks.

 

Chris

5 REPLIES 5
Message 2 of 6


@ChrisPicklesimer wrote:

I would like to get wall component info (location & size) of a wall style.  Is this possible?    Could anyone give me a nudge in the right direction?

 

Thanks.

 

Chris


Hi Chris,

Yes, it's possible, We can access wall start & end point, wall style, size from programtically, Use .net api you can easily get the requirements.

Thanks,
Malli.

 

Message 3 of 6
ngogol
in reply to: nagamalliv

Can you elaborate a little about how to access wall style via API?

I even cant find StyleName

Message 4 of 6
nagamalliv
in reply to: ngogol

public static Autodesk.AutoCAD.DatabaseServices.ObjectId GetWallStyleId(string name, Database db, Transaction trans)
{
Autodesk.AutoCAD.DatabaseServices.ObjectId wallStyleId = Autodesk.AutoCAD.DatabaseServices.ObjectId.Null;
DictionaryWallStyle wallStyleDict = new DictionaryWallStyle(db);

if (wallStyleDict.Has(name, trans))
{
wallStyleId = wallStyleDict.GetAt(name);
}

return (wallStyleId);
}

Message 5 of 6
ngogol
in reply to: nagamalliv

Thanks, but I even cannot find how to get styleName from Wall objet

Message 6 of 6
ChrisPicklesimer
in reply to: ngogol

I use this to get the wall style name by passing in the ID of wall object.

 

Snippet

    Public Function GetWallStyleName(ByVal objID As ObjectIDAs String
        Dim sReturn As String = ""
 
        Dim db As Database = Autodesk.AutoCAD.DatabaseServices.HostApplicationServices.WorkingDatabase
 
        Using tr As Transaction = db.TransactionManager.StartTransaction()
            Dim objWall As Wall = CType(tr.GetObject(objID, OpenMode.ForRead, False), Wall)
            Dim styleID As ObjectID = objWall.StyleId
 
            Dim objWallStyle As WallStyle = CType(tr.GetObject(styleID, OpenMode.ForRead, False), WallStyle)
            Dim strWallStyleName As String = objWallStyle.Name
            sReturn = strWallStyleName.ToString
            tr.Commit()
        End Using
 
        Return sReturn
 
    End Function

 

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