08-09-2022
03:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-09-2022
03:47 AM
the property "invApp.ActiveDocument" will always return a object of the type "Document". the "Document" type does not have a property "ComponentDefinition". The type "PartDocument" has this property. Therefore you need to tell the compilere that it is save to treat the "invApp.ActiveDocument"as a "PartDocument". In VB.net you would do it like this:
Dim oPartDoc As PartDocument = invApp.ActiveDocument
or in C# (which is a bit more strict)
PartDocument oPartDoc = (PartDocument)invApp.ActiveDocument
But I dont know how you would cast in Python.
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com