Hi,
I have made an add-in that automates the insertion of points on a surface and I am trying to find out how to put these points on a specific layer. I guess that changing the "standard" default Point style would do the trick, but I can't find the objects to use in the Civil3D API.
Any suggestions?
Civil3D 2012
VS 2010, VB or C#
I am using a csv file with the ImportPoints function. The format is PENZD. It works fine on 64bit (not on 32)
The AeccPointImportOptions only reflects what is in the application and Insert > Points from File.
By the way, the option
.PointDuplicateResolution = AeccPointDuplicateResolutionType.aeccPointDuplicateOverwrite
does not work. A dialog is still shown.
Sometimes the layer is already there sometimes I have to create it.
Maybe I should try to create a Description Key Set at Runtime and use its Code property as the D in the csv file?
The problem is that I can't figure out how to do it and if it is the right approach in C3D.
(My first app in this context, most of my projects are for Map, Mechanical or Inventor.)
@Anonymous wrote:
I am using a csv file with the ImportPoints function. The format is PENZD. It works fine on 64bit (not on 32)
The AeccPointImportOptions only reflects what is in the application and Insert > Points from File.
By the way, the option
.PointDuplicateResolution = AeccPointDuplicateResolutionType.aeccPointDuplicateOverwrite
does not work. A dialog is still shown.
Sometimes the layer is already there sometimes I have to create it.
Maybe I should try to create a Description Key Set at Runtime and use its Code property as the D in the csv file?
The problem is that I can't figure out how to do it and if it is the right approach in C3D.
(My first app in this context, most of my projects are for Map, Mechanical or Inventor.)
This could probably work well, just use a description of * to apply to all the points. You can create a temporary DescriptionKeySet, add one Key specifying the layer, then delete the Set once done.
Get the DescriptionKeySets collection, add a new Set, add a key to the set. Although I'm not sure if you can specify the order for multiple DKSets.
Another option would be to create a temporary point group and set the importoptions to use that group. You could then loop through the points to set the layer in the group after the import completes.
Actually, it sounds like you want all of the points to go on a specific layer? If so, check for the existence of that layer, create it if needed, set that layer as the current layer before the import process, after the import set the current layer back to what it was.
Thank you very much for your suggestions. They make sense.
The project is on hold for a few days but I will give these a try some other time and will post my results.