Open DWG or Inventor DWG

Open DWG or Inventor DWG

Anonymous
Not applicable
752 Views
5 Replies
Message 1 of 6

Open DWG or Inventor DWG

Anonymous
Not applicable

Hi there,

 

I'm programming in C# with Inventor 2017/2018. I'm creating an addin that needs to open autocad DWG and Inventor DWG files. The question is, how can I determine what kind of DWG it is, in order to use AutoCAD or Inventor to open the dwg ?

 

 

0 Likes
753 Views
5 Replies
Replies (5)
Message 2 of 6

Rob67ert
Collaborator
Collaborator
Hoi Remy,

as far as i know, you can't.
Robert

If you find this reply helpful ? It would be nice if you use the Accept as Solution or Kudos button below.
0 Likes
Message 3 of 6

frederic.vandenplas
Collaborator
Collaborator

Yes you can, before you open the file, you can check if it's an Inventor dwg or not

 

If InvApp.FileManager.IsInventorDWG(File.FullName) = True Then
...
end if
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 4 of 6

Anonymous
Not applicable

Thanks for your reply frederick, but your solution assumes that an application is already active.

 

What I want is to somehow determine what kind of dwg I am dealing with and depending on that, start the appropriate application.

 

Something like this:

 

Find somekind of (windows) property which tells me what kind of dwg it is.

 

if (dwg,type == inventordwg) open the drawing in inventor

else open it in autocad.

 

The property must be somewhere, because when I double click on a dwg in the windows explorer, it knows which application to use to open it.

 

0 Likes
Message 5 of 6

frederic.vandenplas
Collaborator
Collaborator

Hi,

 

In that case the only possible solution is to see if the attributes of the file are accesible through windows explorer

I never tried that, but you can start an inventor apprentice server session, and check there if it is an Inventor dwg.

Should take only some milliseconds to recognize.

 

http://modthemachine.typepad.com/my_weblog/2010/03/iproperties-without-inventor-apprentice.html

 

https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to...

 

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 6 of 6

Anonymous
Not applicable

okay, this might be a workable solution, thanks.

 

0 Likes