Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
738 Views, 2 Replies

VBA code - Step export from idw

Hi All,

 

 I need the code that would open ipt or idw from first sheet first view and generate step file from it.

Then after export switch bacjk to idw as active document.

 

Also I am using code t update part:

Dim oDocument As Document
Set oDocument = ThisApplication.ActiveDocument

oDocument.Update

 But this code do not update idw - all sheets

 

Any help woul be great.

 

Regards

 

Anonymous
in reply to: Anonymous

Hi All

I have found this code:

'Update Drawing

Dim oDocument As Inventor.DrawingDocument
Set oDocument = ThisApplication.ActiveDocument
Dim oSheet As Inventor.Sheet
oSheet = oDocument.Sheets(1)
If oDocument.RequiresUpdate Then
oDocument.Update
oDocument.Save
End Sub

 But It fails at:

oSheet = oDocument.Sheets(1)

 Invalid use of property.

 

Thanks

Anonymous
in reply to: Anonymous

Because this property is an object. Therefore, in vba, you must use "Set" keyword.

 

Set oSheet =  oDocument.Sheets(1)