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

Set Style of ACA Objects

3 REPLIES 3
Reply
Message 1 of 4
ChrisPicklesimer
457 Views, 3 Replies

Set Style of ACA Objects

With the help of code found in this NG, I have been able to import ACA styles from a library dwg.  Once the style has been imported I am not sure how set the style once I create various ACA objects.  For structural member and wall objects I have created, I see a StyleID property.  I am assuming that is how I set the style.  How do I get the StyleID of ACA styles within a dwg file?

 

Thanks.

 

Chris

3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: ChrisPicklesimer

Public Shared Function GetWallStyleId(ByVal name As String) As ObjectId
            Dim db As Database = Autodesk.AutoCAD.DatabaseServices.HostApplicationServices.WorkingDatabase
            Dim wallStyleId As ObjectId = ObjectId.Null
            Using tr As Transaction = db.TransactionManager.StartTransaction()
                Dim wallStylesDict As New Autodesk.Aec.Arch.DatabaseServices.DictionaryWallStyle(db)
                If wallStylesDict.Has(name, tr) Then
                    wallStyleId = wallStylesDict.GetAt(name)
                End If
                tr.Commit()
            End Using
            Return wallStyleId
        End Function

 

Message 3 of 4

Thanks for the quick reply.  That is exactly what I needed.

 

Chris

Message 4 of 4
Anonymous
in reply to: ChrisPicklesimer

I use MEP and not much of the arch styles

It was a function I used for panelstyles I modified it for wallstyles, I did not test it

so let me know if it does not work

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