Community
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
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
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