I’ve trying to retrieve the profile view style ID from an existing profile view. Below is the part where I try to do that, I can get the profile view name from profile_view.Name, but when I try to get the style ID, i get this error: AttributeError: ‘ProfileView’ object has no attribute ‘StyleId’.
The documentation does say that it should have StyleId, but it only “Sets the ProfileView’s style by ObjectId.” So I am wondering is there a way to get the style ID from an existing profile view? ProfileView Members
@tzL6PRM you are correct, you can only set the StyleId from the property, you need to get the StyleName parameter instead. From the Document.Styles.ProfileStyles[StyleName] you can get the ObjectId associated.
Thank you for your reply, the Civil 3D toolkit does work, but everything is written in python, so I’d like to stick to it, is it possible to do it just in Python? Also, profile_view.StyleName also gives me the attribute error. Thanks
import clr
clr.AddReference('Autodesk.Civil3DToolkit')
from Autodesk.AutoCAD.DynamoNodes import DocumentExtensions
OUT = DocumentExtensions.GetStyle(IN[0])