Author Topic: Civil 3D Data Shortcuts | Working Folder  (Read 11177 times)

0 Members and 1 Guest are viewing this topic.

BlackBox

  • King Gator
  • Posts: 3770
Civil 3D Data Shortcuts | Working Folder
« on: July 02, 2012, 04:02:14 PM »
Is there a way to programmatically change the Civil Application's Working Folder Property in Civil 3D 2011 or newer?

Attempting to dig through the Civil 3D .NET API, I came across the AssociateShortcutsProjectId Property, but this appears to require a newer build of AeccDbMdg.dll (9.0.1780.0) than that which is included with Civil 3D 2012 (9.0.1619.0).


** Edit - Another reference: http://docs.autodesk.com/CIV3D/2012/ENU/API_Reference_Guide/net/!!MEMBERTYPE_Properties_Autodesk__Civil__Settings__SettingsRoot.htm


I'm not even sure if this Property is what I am after (in the Working Folder), but it's appearing as though this Feature has not been exposed to the versions of the Civil 3D API that I would need to use anyway.

Any guidance or clarification would be greatly appreciated.

TIA
« Last Edit: July 02, 2012, 04:19:26 PM by RenderMan »
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #1 on: July 02, 2012, 07:47:51 PM »
AssociateShortcutsProjectId was available in C3D2010, but it only lets you set the project, not the working folder. That version info you see on the help page is just the version that was searched by their new automatic API help constructor, don't pay much attention to that.

I have never been able to find a way to set the WorkingFolder. I know I could sure put it to use.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #2 on: July 02, 2012, 08:18:14 PM »
I should expand that reply to say I know WHERE the data is stored, I just haven't found a way to edit it while C3D is open. The working folder is saved in an XML file, this can be edited outside of C3D and it will be used the next time C3D loads. But I cannot get C3D to re-read the XML file after it has been started. And I'm not sure why C3D is not saving the Current WorkingFolder in the WorkingFolders.xml, it's like this is the default folder to use if those in the Shortcutfolders cannot be found.
"C:\Users\<UserName>\AppData\Roaming\Autodesk\C3D 2012\enu\Project Management\ShortcutFolders.xml"
"C:\Users\<UserName>\AppData\Roaming\Autodesk\C3D 2012\enu\Project Management\WorkingFolders.xml"

Anyway, this may, or may not, help with what you want to do.

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #3 on: July 02, 2012, 08:46:07 PM »
Thanks for the clarification, Jeff.

As I'm sure you and other C3D users are, developer kind or not, I'm disappointed in Autodesk's lack of foresight, that one would want to be able to add some working folder automation given that Autodesk failed to implement an appropriate DocumentBecameCurrent Event monitor that would/should automagically change the working folder based upon if the ActiveDocument is associated with a given project.

That and the fact that the Set Working Folder dialog precludes one from navigating to the destination location via shortcut (.LNK), is equally frustrating.

/vent
"How we think determines what we do, and what we do determines what we get."

wooz

  • Guest
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #4 on: July 05, 2012, 09:59:28 AM »
To re-read the content from the XML use the command "REFRESHSHORTCUTNODE".  We use a document management system with some other customizations that allow us to build out the path to the working directory.  My addin checks the ShortcutFolders.xml to see if it is in the list, if it is the it sets the attribute "current=1" and all others =0.  If it does not then it writes it to the xml file. 

This method is kind of a hack but works pretty well until Autodesk provides something better. 

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #5 on: July 05, 2012, 11:31:54 AM »
Thanks for that bit of info, wooz! Sure would've been nice of the folks at ADN to have let me know about that command. Your 'hack' is nearly identical to what I had tried to implement, but failed due to not knowing about the one command.

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #6 on: July 05, 2012, 11:38:00 AM »
Thanks for that bit of info, wooz!

1+

Awesome; thanks, wooz! :beer:
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #7 on: November 16, 2012, 07:33:58 AM »
Could someone confirm that this is issue has, or has not, been addressed in Civil 3D 2013?
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #8 on: November 16, 2012, 09:24:57 AM »
Addressed how? From what I can tell, it was/is working as designed. (May not be how you or I would've done it, but someone thought it was the 'right' thing to do.)

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #9 on: November 16, 2012, 09:37:03 AM »
Thanks for the prompt reply, Jeff.

Addressed how?

As I understand it for Civil 3D 2011, and 2012, when one switches documents, the Toolspace palette's Propsector, and Settings tabs are updated to reflect the MdiActiveDocument's data (style, etc.), yet the Working Folder data remains static.

I would consider this to be addressed, by implementing the necessary code behind (and perhaps additional XML support?) to allow the DocumentBecameCurrent Event to trigger an update of the Working Folder data as well.

My $0.02

From what I can tell, it was/is working as designed. (May not be how you or I would've done it, but someone thought it was the 'right' thing to do.)

I am not arguing the point of right or wrong here, I am simply trying to confirm that the behavior observed in previous releases (2011, 2012, etc.) has, or has not, been changed.
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #10 on: November 16, 2012, 09:52:58 AM »
OK, gotcha. I'm still just waking up and had to go do some testing to jog my memory as to what the issue is. 2013 behaves the same as previous versions...opening a drawing whose shortcut folder has been saved with the dwg, while the working folder is set to another folder, results in the project not being found.

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #11 on: November 16, 2012, 10:00:36 AM »
OK, gotcha. I'm still just waking up and had to go do some testing to jog my memory as to what the issue is. 2013 behaves the same as previous versions...opening a drawing whose shortcut folder has been saved with the dwg, while the working folder is set to another folder, results in the project not being found.

No worries; thank you, Sir.
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #12 on: January 09, 2013, 08:35:03 PM »
I've been contemplating this topic, and wanted to know how one would get the current project association from a given MdiActiveDocument (presumably via some Civil Namespace)?
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #13 on: January 09, 2013, 11:19:33 PM »
I had thought that this should do it:
public string AssociateShortcutProjectId { get; set; }

but it returns an empty string whether there is a project associated to the drawing or not. Still searching...

BlackBox

  • King Gator
  • Posts: 3770
Re: Civil 3D Data Shortcuts | Working Folder
« Reply #14 on: January 10, 2013, 12:32:06 AM »
Thanks for looking, Jeff.  :-)
"How we think determines what we do, and what we do determines what we get."