Q\ How to create data shortcuts for Civil3D objects using Civil3D API?

Q\ How to create data shortcuts for Civil3D objects using Civil3D API?

khaled.al-agamy
Explorer Explorer
492 Views
4 Replies
Message 1 of 5

Q\ How to create data shortcuts for Civil3D objects using Civil3D API?

khaled.al-agamy
Explorer
Explorer

Hello everyone,

 

I was wondering how to create a data shortcut for Civil3D objects such as alignments, surfaces, etc. using the Civil3D API because I couldn't find a method to automate this process.

Any suggestions?

 

Thank you in advance.

0 Likes
493 Views
4 Replies
Replies (4)
Message 2 of 5

hosneyalaa
Advisor
Advisor
0 Likes
Message 3 of 5

khaled.al-agamy
Explorer
Explorer

I want to create a data shortcut from a drawing to use it in another drawings, I know there is a method to create a reference from data shortcut, But I can't find the member to create data shortcut for that reference from the original drawing.

0 Likes
Message 4 of 5

hippe013
Advisor
Advisor

To create a Data Shortcut you can use the SetSelectItemAtIndex method of the DataShortcutManager. The index you use is the same index as used in the method GetExportableItemAt. After setting the DataShortcut you will need to save the DataShortcutManager using the DataShortcuts.SaveDataShortcutManager method. After saving the DataShortcutManager you will need to refresh the shortcut node using the "RefreshShortcutNode" command. I hope this helps to get you going in the right direction. 

0 Likes
Message 5 of 5

andrewpuller3811
Advisor
Advisor

I have found a couple of projects that create and use data shortcuts.

 

One that works directly in civil 3d is here - https://github.com/C3DReminders/DFWBIUG_C3D_Data_Shortcuts_2020 

 

Another one that works in dynamo - https://github.com/mzjensen/Camber

 

Hopefully these can give you an idea.



If a post provides a fix for your issue, click on "Accept as Solution" to help other users find solutions to problems they might have that are similar to yours.

Andrew Puller
Maitland, NSW, Australia
Windows 11
Intel core i7 11800 @ 2.30 GHz with 32GB Ram
Civil 3d 2023