01-20-2021
08:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-20-2021
08:05 AM
What are you attempting to use that document variable for later in your macro? You may need to define it as its true document type (PartDocument or AssemblyDocument) before it will allow certain actions/access related to it.
Here is one approach (of many):
Dim oDocType As DocumentTypeEnum
Set oDocType = ThisApplication.ActiveDocumentType
If oDocType = kPartDocumentObject Then
Dim oPDoc As PartDocument
Set oPDoc = ThisApplication.ActiveDocument
GoTo PartStart '(place in code dealing with PartDocument stuff)
ElseIf oDocType = kAssemblyDocumentObject Then
Dim oADoc As AssemblyDocument
Set oADoc = ThisApplication.ActiveDocument
GoTo AsmStart '(place in code dealing with AssemblyDocument stuff)
End If
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE'
.
If you have time, please... Vote For My IDEAS
or you can Explore My CONTRIBUTIONS
Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield
(Not an Autodesk Employee)