Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Maintain association between drawings and their DRefs working folder & project

Maintain association between drawings and their DRefs working folder & project

If a drawing contains DRefs, the DRef working folder and project should be saved within the .dwg so when you open the drawing, it remembers it's associated DRefs and prompts you to make that DRef project active. 

9 Comments
BlackBox_
Advisor

1+

 

The entire Working Folder + DREF malarkey is and has always been a kludge, just so Autodesk could break from Land Desktop's external database, in favor of Civil 3D's wonderfully marvelous (and inherently slower, more cumbersome) internal database.

 

From this thread, back on 2015-08-14... and nothing's changed but the date:

 

 http://forums.augi.com/showthread.php?160711-_Shortcuts-Folder-Location&p=1299188&viewfull=1#post129...

 


@BlackBox_ wrote:

For those not already familiar with Civil 3D's Data Shortcuts workflow.... 

 


@BlackBox_ wrote:

<<snip>>

 

Rather than....

 

Iterating each GetAlignmentIds(), GetPipeNetworkIds(), and GetSurfaceIds(), etc., checking for IsReferenceObject == true, get the CivilDocument.Settings.AssociateShortcutProjectId string, then open <<RoamableRootPrefix>>\\Project Management\\ShortcutFolders.xml as XmlDocument, to iterate WorkingFolder\ShortcutFolder XmlNodes, filtering for "uuid" XmlAttribute's string value that == CivilDocument.Settings.AssociateShortcutProjectId string, to get "path" XmlAttribute's string value, then iterate the XML files found at "path" XmlAttribute's string value + \\_shortcuts\\<<AeccObjectReferenceType>>\\ filtering for <<FileName>>.Contains(<<DataReferenceName>>) (or WCMATCH same?), to then open THAT as XmlDocument, reading ProjectInfo\Shortcuts\Shortcut\Criteria\File XmlNode's "name" XmlAttribute's string value, to get source\parent model drawing... Sheesh, I'm winded just typing all of this malarchy, and we haven't even updated the Data References yet! Haha

 

... Isn't there a simpler way of going about this entire procedure?

 

The Working Folder history is stored in <<RoamableRootPrefix>>, but if that is just pointing to the location of ..\_shortcuts\ folder, and the CivilDocument.Settings contain the Associated Project ID, then why not just point directly to the same ..\_shortcuts\ folder in the first place? (or add exposed Properties to CivilDocument.Settings that expedite even this!?)

 

There, in the ..\_shortcuts\ folder, exists another ShortcutsHistory.xml file, which only contains the Project's UUID XmlAtrribute string value. stored to both <<RoamableRootPrefix>>\\Project Management\\ShortcutFolders.xml, and CivilDocument.Settings in kind... Would it not then be simpler, to store the Data References in ..\_shortcuts\ShortcutsHistory.xml file respectively with an AECC* Object XmlNode separating them, rather than an entirely dependent sub-folder structure only to store each XML file individually?

 

The whole things is just overly complicated, to my simple mind.

 c3d.data.shortcuts.workflow.png



 

jameshitt
Collaborator

Cheers to that. Data shortcuts are a ghastly, horrendous mess that they should be quite embarrassed of.

Kevin.Spear
Advisor

Um, all you have to do is type SHORTCUTASSOCIATEENABLE. This is not a dwg variable but a system variable. With this enabled, anytime you switch drawings, the current project will change with it. In fact, it will also change your working folder should it need to do so. Or, did you already know that and it's not working for you?

pmascaro
Advocate

@Kevin.Spear , No, I did not know that. I would assume something like this would be set as the default. Maybe it is and it just does not work for me. I set it to enable just to be sure and bounced between a few drawings that are associated with different working folders and projects and it didn't work for me, but at least now I have a starting point to pick back up w/ our enterprise support lead as this is the first I'm hearing of this capability.

My workflow is that we set a working folder to the project directory and we set up separate project folders as needed within the project for various phases or designs.

The only thing this changed is that it maintained the last working folder that I was in when I re-launched C3D. Maybe it only works for associated projects and not working folders?

Thanks for the tip.

-Paul

BlackBox_
Advisor

@Kevin.Spear technically, SHORTCUTASSOCIATEENABLE is one of a few undocumented Commands (like SHORTCUTASSOCIATEDISABLE, etc) that happens to modify a Registry key, but aren't actually system variables according to SYSVDLG, Civil 3D Help, etc.

 

Completely agree this *should* be enabled, BTW. :beer:


The entire Data Shortcuts mechanism is still an external XML file kludge, to make the internal database 'work' (see image above), and lacks the basic intelligence to NOT synchronize DREFs that aren't out of date, which just unnecessarily increases drawing open, publish, etc times.

 

Constantly synchronizing every DREF without the context of what's current and what's not, does not 'dynamic' make; that is just a misnomer for code inefficiency.

 

Cheers

pmascaro
Advocate

@BlackBox_ I know they are working on this one... "to NOT synchronize DREFs that aren't out of date" including if you save a drawing, but you did not update anything that is referenced within that drawing. With this, you will not be notified every time a drawing is saved that is DREFed too... No idea when that's going to happen though... Just know there is discussion around it.

 

I just want to be able to open my drawing and have it find it's working folder and DRefs without the end user having to fish to the project to set a the working folder through the data shortcut manger every time... Sees easy enough to me, but to no avail... I tried this "SHORTCUTASSOCIATEENABLE " and it didn't work for me... the working folder just remains what it was originally set to.

BlackBox_
Advisor

@pmascaro that could be caused by a couple of different things - I can tell you that's not how Civil 3D is supposed to work - Civil 3D does correctly update the Toolspace when switching/opening Documents.

 

One reason could be that Civil 3D isn't finding the associated project and should report that to the Command Line.

 

If the project is being found (per the Command Line), but Toolspace isn't correctly updating then you might check your project template to make sure the ..\_shortcuts\ folder doesn't include an ShortcutsHistory.xml file (this is where the respective Project's uuid is stored).

 

Many moons ago when we first adopted Civil 3D, I had accidentally done that - included a ShortcutsHistory.xml in my project template - the result is that Civil 3D technically finds the project, but the Toolspace never updates correctly, instead updating to what it's already set for (because of the duplicate ShortcutsHistory.xml files that have the same Project uuid).

 

Which does your Command Line report?

 

HTH

pmascaro
Advocate

@BlackBox_ Odd. When I open a drawing, nothing loads in Toolspace, and nothing is reported at the command prompt. I can however open two different drawings associated with two different workspaces & projects and synchronize their surfaces so it looks like it's the issue is that it's just not loading into Toolspace. Both projects had the ShortcutsHistory.xml file. I removed them, but still nothing. I have to manually map to the workspace in Toolspace for my shortcuts to show up.

 

I do not use a project template when creating new data shortcut working folders.

BlackBox_
Advisor

@pmascaro That is odd.

 

The ShortcutsHistory.xml file should be there - so for any that you've deleted you should set the Working Folder accordingly, as that forces the creation of a **unique Project UUID, and that must then be associated to the applicable drawings in kind.

 

**Note - theoretically the UUID is unique, but only unique to your workstation as the overall Data Shortcut mechanism is dependent on your local ShortcutFolders.xml file, which is located here (2019 as example):

 

%AppData%\Autodesk\C3D 2019\enu\Project Management\ShortcutFolders.xml

 

Despite the 'internal database' and potential Project association & Data Shortcuts that reside on the server, Civil 3D still doesn't have a means by which to have CAD Admins locate this file to a user-accessible folder on the network as part of our setup so one user adds a new project and we all immediately have access to it (upon Drawing open).

 

As-is today (ShortcutFolders.xml on each workstation), if I create/add a Project and associate that Project's drawings with same, another user here has to first set the working folder on their workstation before Toolspace will correctly populate.

 

I keep hoping for Autodesk to fix this, but at some point, I'm just going to get fed up and code an App to do this, so that each user's workstation-saved ShortcutFolders.xml file is synced with a networked copy. In some preliminary testing this seems to work, as I can manually edit the XML outside of C3D and invoke REFRESHSHORTCUTNODE Command to reload Toolspace, just need some free time to do it to completion so I can distribute & publish Exchange App Store, etc.

 

Sorry I couldn't be of more help. :beer:

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Answer Day

Rail Community


 

Autodesk Design & Make Report