Print
Choosing the “right” Autodesk application to open a .dwg file with
Posted: 08 August 2008 11:09 AM   [ Ignore ]  
Sr. Member
RankRankRankRank
Total Posts:  223
Joined  2008-04-24

We are having some issues with the Project Center and Viewer applications using the proper Autodesk application to open DWG files.  Out issue is being caused by the fact that many people have multiple versions of Autodesk products installed (e.g. AutoCAD 2005, AutoCAD 2007, AutoCAD 2009, ABS 2006, etc.) but the both of the Newforma programs are only saving one available option for the DWG file type.

Even when we manually add an executable to the open-with list (by clicking the ... button in the Viewer for example), it is not available as a choice the next time a DWG file is opened.

As I pointed out in the http://www.newformant.com/index.php/talk/viewthread/163/ thread, we are looking to get a custom script implemented to set the “proper” Autodesk application set for each project, but I’d like to leverage as many built-in Project Center features as possible before we add anything custom.

Thanks,
Matt

Profile
 
 
Posted: 08 August 2008 12:51 PM   [ Ignore ]   [ # 1 ]  
Member
RankRank
Total Posts:  37
Joined  2008-03-11

Hi Matt

Currently, only one set of Newforma Project Center file associations is supported. It can’t be changed on a per-project basis and the set is loaded once per run of Project Center.

However, you *can* specify multiple programs per file type. So you could add several different versions of Autocad to the .dwg file type. The user has to switch the selection manually using the “Configure File Associations” task (on the top toolbar) after opening the project, though.

I will add a feature request for per-project file associations on your behalf.

Thanks,

Faan

Profile
 
 
Posted: 08 August 2008 01:39 PM   [ Ignore ]   [ # 2 ]  
Sr. Member
RankRankRankRank
Total Posts:  223
Joined  2008-04-24

Some follow-up questions for additional clarity on our part:

- Where does Project Center read its list of available applications from (the list that comes up when you go to manually change a file associate)?

- Does Project Center spawn the external program to open a file with a full command line to the actual program EXE file, or does it hand off the file name to Windows and use the underlying file association in Windows to actually find and launch the proper EXE?

- For a DWG file, when choosing the “Open with AutoCAD Application” option from the tasks pane, how does Project Center determine which actual program to launch if there are multiple available Autodesk applications installed on the system?

Thanks,
Matt

Profile
 
 
Posted: 08 August 2008 02:22 PM   [ Ignore ]   [ # 3 ]  
Member
RankRank
Total Posts:  37
Joined  2008-03-11

Hi Matt

To answer your questions in order:

1. Newforma Project Center gets the list of programs from HKEY_CLASSES_ROOT\Applications. It also uses Win32 functions to get file associations and icons.

2. In the case of Project Center file associations, it launches the executable using its full path and passes the target file (the DWG file for example) as a command line argument. It does use the Windows file association to launch. In other words, it uses the shell\open\command syntax like this:

“C:\Program Files\Adobe\Acrobat 8.0\Acrobat\Acrobat.exe” “%1”

3. It uses the full path to the executable selected in the Configure File Associations dialog. Presumably, each AutoCad application will have a different path to its main executable.

Hope this helps clarify,

Faan

Profile
 
 
Posted: 08 August 2008 09:05 PM   [ Ignore ]   [ # 4 ]  
Sr. Member
RankRankRankRank
Total Posts:  223
Joined  2008-04-24

Thank you, Faan.

I’ve tried some proof-of-concept code with a simple batch file and it works perfectly.  I have the batch file manipulate the HKCR\.dwg registry key based on which project number is being opened, forcing it to use a certain Autodesk application for certain project numbers.  It will take a bit more work to get this working on a wide scale (I’m not going to maintain a mapping of ALL our project numbers in a batch file!), but it looks very promising and will help us solve a major problem we have been having.

Also, your answer to #1 is going to help me fix a problem one of our users was having in the Viewer.  If he opened the source file from within the viewer, it was launching the “wrong” application.  I think I now know why.

Thanks again!
Matt

Profile
 
 
Posted: 08 September 2008 03:23 PM   [ Ignore ]   [ # 5 ]  
Sr. Member
RankRankRankRank
Total Posts:  223
Joined  2008-04-24

I just received another, related request from one of our users that I’d like to get out here for review.

We would like to be able to open a DWG file as “read-only” in an AutoCAD application from within the Project Files activity center.  We realize that we can use the Viewer for read-only mode, but we have an ever increasing number of projects using 3D drawings in ABS and the lack of support for those files in the Viewer is becoming a big issue for us.

The ability to launch the DWG as read-only in a native AutoCAD application would at least help mitigate the issue with the Viewer not being able to render 3D objects.

Matt

Profile
 
 
Posted: 11 September 2008 01:40 PM   [ Ignore ]   [ # 6 ]  
Member
RankRank
Total Posts:  37
Joined  2008-03-11

Hi Matt

Do you know of a flag or method for launching DWG files in AutoCAD as read-only?

Faan

Profile
 
 
Posted: 11 September 2008 07:31 PM   [ Ignore ]   [ # 7 ]  
Member
Rank
Total Posts:  4
Joined  2008-07-07

The simplest method for that specific task is probably to use a vbscript launcher and hand the drawing name to the script.

Set args=Wscript.Arguments
Set acad 
CreateObject("AutoCAD.Application")
acad.Documents.Open args(0), True 

Which is…clearly not robust, but illustrates the basic idea.

If/when we can associate a Newforma project with specific AutoCAD versions & verticals, it would be nice to have the option to open DWG files with a robust launcher that checks the user’s computer for the specified application(s).  Lacking them, maybe tries DWG TrueView (until ODA reverse-engineers ABS, at least) before defaulting to the Newforma Viewer. 

That approach would have the benefit of not trying to fight the various AutoCAD softwares and their file-association-musical-chair shenanigans.

-drg

Profile
 
 
Posted: 12 September 2008 10:26 AM   [ Ignore ]   [ # 8 ]  
Sr. Member
RankRankRankRank
Total Posts:  223
Joined  2008-04-24

Dan’s post summarizes what I know about the available options for triggering a read-only file open from outside of AutoCAD (we talked about it yesterday afternoon before he posted his response).  I found a couple of references for read-only file open methods - here are two examples:

http://www.cadforum.cz/cadforum_en/qaID.asp?tip=2063
http://discussion.autodesk.com/thread.jspa?messageID=1134091

But, these rely on AutoCAD already being open in order to run the scripts that trigger the read-only open action.

Matt

Profile