Find IDW file from inside an IPT file

Find IDW file from inside an IPT file

Anonymous
Not applicable
418 Views
2 Replies
Message 1 of 3

Find IDW file from inside an IPT file

Anonymous
Not applicable

Hi guys and gals, is there a way to find a file in the Workspace without knowing the full path? 

 

I'm basically trying to recreate the "Open drawing" function (in the browser), but with the drawing not being in the same folder as the IPT or IAM. 

 

Any ideas?

 

Thanx

0 Likes
Accepted solutions (1)
419 Views
2 Replies
Replies (2)
Message 2 of 3

Owner2229
Advisor
Advisor

Hi,

Im ussualy saving the full path to the drawing in model's custom iProperties.

It's saved from the drawing when it's saved.

You can then use this iProperty to open the drawing from wherever it is.

 

I fear that searching the whole workspace for each drawing would be quite slow and annoying.

On the other hand, having all the drawings in one folder and searching just the one would be fine.

 

Here's the code that looks if the file exists:

 

Dim Filename As String
Filename =  "C:/Whatever/part.ipt"
If Dir(Filename) <> "" Then
   MsgBox("It exists !")
End If

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
Message 3 of 3

ekinsb
Alumni
Alumni
Accepted solution

I recently wrote a blog post that covers this specific topic.

http://modthemachine.typepad.com/my_weblog/2016/01/open-drawing-from-a-part-or-assembly.html

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog