libredwg icon indicating copy to clipboard operation
libredwg copied to clipboard

dwgadd: set table by name

Open michal-josef-spacek opened this issue 1 year ago • 5 comments

In doc is construct like:

line (0 0 0) (100 0 100)
line.layer = "1"

But output is:

ERROR: dwg_dynapi_entity_set_value: Invalid LINE field layer

in dwgadd -v9 --as r11 -o line.dwg foo.dwgadd

michal-josef-spacek avatar Jun 02 '23 09:06 michal-josef-spacek

you cannot reference a layer, which does not exist yet. so the error is correct

rurban avatar Jun 02 '23 12:06 rurban

you cannot reference a layer, which does not exist yet. so the error is correct

ok, that's a good point. Thanks

But when I have:

layer "foo"
line (0 0 0) (100 0 100)
line.layer = "foo"

The layer was created and error is same

michal-josef-spacek avatar Jun 02 '23 12:06 michal-josef-spacek

this does not work yet, as the layer must be a handle, not a name. with r11 even a number (index) only. maybe we should accept table names also

rurban avatar Jun 02 '23 12:06 rurban

There is another use case in R_1_4, where is a table of indexed layers. When I set:

line (0 0 0) (100 0 100)
line.layer = "2"

This could be layer index = 2 automatically.

michal-josef-spacek avatar Jun 02 '23 12:06 michal-josef-spacek

This is up to r12, and should work already

rurban avatar Jun 02 '23 13:06 rurban