Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

description key editing

74 REPLIES 74
SOLVED
Reply
Message 1 of 75
allywhite666
7662 Views, 74 Replies

description key editing

Is anyone else disappointed with the description key editor in C3D?

I have been trying without success to find an easy way to edit description keys, copy and paste keys and do simple tasks with them.

The key editor in C3D is horrible, I would much prefer to be able to edit the keys in excel.

I am able to import and export the files using Sincpac-C3D but once they are exported you can't edit them or do anything to them so this is only good for backing up.

some things that I find annoying are -

If I have 2 description key files and want to take a few keys from one and put them in another, I can copy them but cant paste them into the second.

If I want to find a key quickly in a description key file I cant simply type the first letter of the key and expect the editor to jump to it, I have to manually scroll through all the keys until I find it.

I think Autodesk needs to improve this feature, anyone else?

74 REPLIES 74
Message 21 of 75
allywhite666
in reply to: GTVic

Ok, so I tried this utility and got an error, see image:

 

error.jpg

 

What did I do wrong?

P.S. If I hit continue it freezes. I am using Civil3D 2015.

Message 22 of 75
GTVic
in reply to: allywhite666

Did that error come up when the macro starts or after clicking a button?

Message 23 of 75
GTVic
in reply to: GTVic

Updated with capability for Figure Prefix Database export/import. Added more error checking during copy procedure. Briefly tested on Windows 8.1 (Civil 3D 2014 and 2015).

Message 24 of 75
allywhite666
in reply to: GTVic

The error came up after clicking the button "copy to clipboard"

Message 25 of 75
allywhite666
in reply to: GTVic

Just tried your second version and the previous error is now gone but I am now getting a warning, see image:

 

error2.jpg

 

After pressing OK it will come up again and again, I think it is warning for each description key because after I hit cancel it told me that my desc. keys have been copied so I hit "Open excel template" and when I paste there is only a few keys in there.

 

You are so close to having this working, It looks great by the way.

 

I think this error will not come up for most people, I am getting it because in my template I have deleted all my point layers (which are empty) so when I import my points only the layers of the points I am importing are created. This stops empty layers being present.

I hope you can fix this error if it is not to much work. Smiley Happy

Message 26 of 75
GTVic
in reply to: allywhite666

I could fix this to operate despite the error but I'm not sure that will be helpful. It would render the macro useless.

 

When the macro looks through the keys it does not see a layer name, just a tag and if it cannot retrieve the original layer then it can't figure out the layer name. Then I would just have to put layer "0" in the export or a blank.

 

Similarly, when the data is pasted back into the drawing through the macro, it will not be able to set the key to a layer that doesn't exist. The same applies to the point style and the point label style. I don't think you would want a bunch of description keys all pointing to layer "0".

 

How do you delete those layers, I have an empty drawing and if I try to delete any layers that are used by a Point Description Key then Civil 3D won't allow that?

Message 27 of 75
allywhite666
in reply to: GTVic

I understand what you mean when it comes to importing but I think the layer list of the description keys is seperate to the layers in the drawing because when I open my description key edtior it shows the layers that the point will be put but in my drawing I have deleated them and had no problems, they don't seem to be linked. It will just create the layer when the point is created.

Perhaps when your macro looks for the layer that the point is to go into there is more than one place it is listed?

Although I have no idea as I know nothing about programing.

Message 28 of 75
GTVic
in reply to: allywhite666

What do you use to edit the description keys?

 

The default editing "Edit Keys..." from the Toolspace Settings tab does not allow entry of non-existent layers.

 

 

Message 29 of 75
allywhite666
in reply to: GTVic

You make the layer first then once the key is made you simply go to layers properties manager and delete it and then save the template.

 

To create a key I go to

Toolspace

   Settings tab

       Point

         Description key sets

             (pick the set or create new) right click select 'edit'

brings me to Description Key editors.

then right click select 'new'

now in the new key I tick the layer box and click on the blank space which brings up "layer selection" box

top right it box 'new' brings up "create layer" box, give it a name and create layer.

Then I close description key editor and go to Layers properties manager and delete the layer and any others I have created and save the template.

 

Message 30 of 75
allywhite666
in reply to: GTVic

If you can make the macro give the option to say "yes to all" on the error it would be fine because otherwise the user will have to click OK to every key when exporting. This would work well. When importing I can add the layer/ layers manually in civil 3D before I import the new keys. It's not perfect but it is better than the way it is.

Message 31 of 75
GTVic
in reply to: allywhite666


@allywhite666 wrote:

You make the layer first then once the key is made you simply go to layers properties manager and delete it and then save the template.


I think the reason I cannot delete the layer is that it is assigned in either a point style or figure style.

 

I've updated to only display error(s) after reading/writing through the keys. Layer "0" is assigned for unknown layers, <default> is assigned for unknown styles. When reading an unknown layer or style the spreadsheet will show <unknown>.

 

 

 

 

Message 32 of 75
GTVic
in reply to: GTVic

Updated further to create layers and styles as needed. The layers will be deleted after updating the Description Key Set, styles cannot be deleted.

 

 

Message 33 of 75
allywhite666
in reply to: GTVic

Wow, that is all I can say.....This works PERFECTLY.

This is probably one of the best things I have found on these forums, this will save a lot of people many headaches.

Autodesk should put you on the pay roll, you are doing their job for them.

Thanks for taking the time to do this, it is very much appreciated by me. Heart

I am sure you will get praise from others also.

 

Message 34 of 75
allywhite666
in reply to: GTVic

There is another way to copy all the keys out and include the layers, you go into description key editor and press ctrl+A to select all, everything goes blue when selected. then hover mouse over the frame of the description key editor at bottom or the right side and right click and select copy to clipboard or hold ctrl and right click anywhere and select copy to clipboard. This will copy everything including the layers.

 

You can also copy just the layer list to the clipboard by going into description key editor and clicking ctrl+A to select all, everything goes blue when selected. Then you can either hover your mouse over the frame of the description key editor under the layer column and right click and select copy value to clipboard (you must be under the column you want to copy) or hold down the ctrl button and right click over any of the layer cells and select copy value to clipboard.

 

Perhaps if you add this copying technique into your macro it will give better results.

Message 35 of 75
GTVic
in reply to: allywhite666


@allywhite666 wrote:

There is another way to copy all the keys out and include the layers, you go into description key editor and press ctrl+A to select all, everything goes blue when selected. then hover mouse over the frame of the description key editor at bottom or the right side and right click and select copy to clipboard or hold ctrl and right click anywhere and select copy to clipboard. This will copy everything including the layers.

 

You can also copy just the layer list to the clipboard by going into description key editor and clicking ctrl+A to select all, everything goes blue when selected. Then you can either hover your mouse over the frame of the description key editor under the layer column and right click and select copy value to clipboard (you must be under the column you want to copy) or hold down the ctrl button and right click over any of the layer cells and select copy value to clipboard.

 

Perhaps if you add this copying technique into your macro it will give better results.


There are tricks to finding windows and simulating key presses to do something like that, but in my opinion that is more of a hack so I wouldn't want to try to add that. I could program the macro to read that clipboard data to fill in missing information when the layers are not present. Or you could just paste the layer column into Excel directly over top of the results from the macro after verifying the order of codes is the same. Or paste in the entire table into another sheet, and use VLOOKUP to get the layer value for each Code. If you pasted the entire panorma into an empty sheet in Excel called Sheet1, the formula for G2 in the main sheet would be =VLOOKUP(A2,Sheet1!A1:E9999,5,FALSE).

Message 36 of 75
allywhite666
in reply to: GTVic

Your macro works great, I was just letting you know about the other way I have been exporting the keys, now I can paste into your excel sheet.

The problem has always been the fact that once you get the keys out you have no way to put them back in and your macro does this.

This makes it invaluable.

Message 37 of 75
mikeevans6697
in reply to: GTVic

I am getting a string of errors when trying to use this utility (AutoCAD Civil 3D 2015 SP3):

 

Command: NETLOAD
Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\mevans\Desktop\TEMP\Description Key Editor\C3D Description Key Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\mevans\Desktop\TEMP\Description Key Editor\C3D Description Key Utility.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
   at loadmgd()

Message 38 of 75
GTVic
in reply to: mikeevans6697

Sorry, didn't see this. A <filename>.dll.config file is required. I will update the download.

Message 39 of 75
GTVic
in reply to: GTVic

Updated:

- includes a .dll.config file to eliminate loadFromRemoteSources security error

- can now copy/update multiple description key sets

- updated for use up to Civil 3D 2018

 

 

Message 40 of 75
Anonymous
in reply to: GTVic

Good Morning 
 
 
 
 
 
 
 

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

Post to forums  

Rail Community


Autodesk Design & Make Report