save dwg as idw - Problem with references in idw

save dwg as idw - Problem with references in idw

H_MERTENS
Contributor Contributor
455 Views
4 Replies
Message 1 of 5

save dwg as idw - Problem with references in idw

H_MERTENS
Contributor
Contributor

Hello,

 

I wrote a short code that saves a dwg as idw. When I open the idw, it can't find the ipt or iam that is referenced to it. I have to select the file. When I upload the idw to Vault, I don't see any "uses" files in the idw. What do I have to do to update the references in the idw? I already tried doc.update() and doc.rebuild() but it didn't help.

 

Thanks

0 Likes
456 Views
4 Replies
Replies (4)
Message 2 of 5

MechMachineMan
Advisor
Advisor

Post your code so we can review it?

 

Also, are you sure you are using the correct project file?


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 5

H_MERTENS
Contributor
Contributor

Hi,

 

this is my code to save the dwg as idw:

 

inv.Documents.Open(dwgLocalPath)
Dim dwgdoc As DrawingDocument = inv.ActiveDocument

Try
   dwgdoc.SaveAs(savePath & fileName.Replace("dwg", "idw"), True)
   inv.Documents.CloseAll()
   inv.Documents.Open(dwgLocalPath)
   dwgdoc = inv.ActiveDocument
Catch ex As Exception
   Return "Error: " & ex.Message
End Try

after this, when I open the idw everything is fine. When I upload the idw to Vault and delete all local files, then get the idw from Vault, only the idw will be downloaded but not the ipt that should be referenced. When I download the ipt, open the idw, save it and check it back in, then everything is fine.

 

Heiko

0 Likes
Message 4 of 5

MechMachineMan
Advisor
Advisor

Hmmm. I'm guessing it might be an issue from changing the file extension?

If you manually change the file extension, do you still have these issues?

By the file extension being dwg and converting it to .idw, I'm assuming it's originally an "InventorDwg", as created in Inventor, and not one created in AutoCAD?


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 5 of 5

H_MERTENS
Contributor
Contributor

Hi,

 

sorry for the delay but I had to take some time offline over easter...

 

When I open the dwg (Inventor DWG) manually and then save this as an idw, I get a message that some files can't be saved, only native Inventor files can be saved. Inventor save the idw file and opens it directly. Everything is fine. When I check it in to Vault and look at the uses, I can see the ipt. So in this way it works, but when I do it over api it doesn't work.

0 Likes