Create a layer with proper linetype and lineweight
Hi,
I'm trying to setup (with c#) some layers in a doc and I'm struggling to enable a linetype and a lineweight by their name/value.
For LightWeight I was happy to find some two functions:
Concerning the LineType I'm trying to set it by the linetype name, I'd expect something like:
I really dont' get how such simple tasks can be so complicated, I hope someone can provide some proper samples.
Thanks
I'm trying to setup (with c#) some layers in a doc and I'm struggling to enable a linetype and a lineweight by their name/value.
For LightWeight I was happy to find some two functions:
bool Database.IsValidLineWeight(short weight)
LineWeight Database.GetNearestLineWeight(short weight)
Concerning the LineType I'm trying to set it by the linetype name, I'd expect something like:
ObjectID Database.GetLinetype("BORDER")
But I have no Idea about how it should be doneI really dont' get how such simple tasks can be so complicated, I hope someone can provide some proper samples.
Thanks
0
Comments
-
Dear MArnold,
those 2 functions
> bool Database.IsValidLineWeight(short weight)
> LineWeight Database.GetNearestLineWeight(short weight)
are actually not implemented; we have an internal task to add this.
In generally, it might help, to first add the newly created LayerTableRecord to the LayerTable - and afterwards assign more properties;
reason is, that several properties have a database correlation, but without being added to the LayerTable, there is no database relation.
hope this helps ?
many greetings !0 -
Yes it helped thanks. Changing the order for some items solved part of my problems, and Autodesk forums helped a lot too.0