from the above, "[...] use the color numbers to identify certain objects in the drawing, even though you cannot see the colors on your screen."
how's that? blocks come to mind, sort of, but this sounds more like a 'light-weight' way of colour-labelling objects, unless i'm not seeing the forest for the trees, that is.
Solved! Go to Solution.
Are you trying to color existing objects in your drawing?
If so you will have to choose a method of selecting them,
either by direct selection or group filtering them, then open
each object for write in a for each, and then applying the
color you want based on your matching criteria.
Can we have details?
Sorry if I mis-understood.
hi, thanks for replying.
the emphasis is on the second part of the sentence, i.e. how to assign a colour number to an object (for identification/tagging/selection/filtering etc) WITHOUT displaying the colour associated with this colour number "on screen". in other words, how can a colour be assigned to an object without colouring the object in that colour.
e.g. set the colour of an object to 'byblock', copy and paste it as block and assign the new block a colour different from the object's explicit or layer's colour. the block appears in the block's colour (whilst the 'byblock' setting of the object within the block turns it black/white inside the block; re-setting the object's colour from 'byblock' to an explicit or via 'bylayer' to its layer's colour makes it appear in that colour again.) this would be one way, sort of, and a 'long' one at that, to assign one colour to an object but display it in another, yet, the way the developer's guide words it gives the impression there is an easier way.
i'd like to find out whether this is indeed possible and if yes, how, or if i'm chasing shadows.
LOL, I' pretty confused, but I think I do somehting silimlar in my software.
Is this what you mean:
As you insert an existing block, using your code you specify a "NEW" .indexcolor and the objects in that block pick up the specified NEW color when inserted?
let me put it this way:
is it possible to assign a colour number to an object (not necessarily a block) without displaying the object in this colour?
(reference .net developer's guide, header 'work with colors', "[...] use the color numbers to identify certain objects in the drawing, even though you cannot see the colors on your screen.")
I think you are mis-reading that particular line. What its referring to is you can check the color setting of an object without it being displayed e.g. off-screen or in a side-database, and use that to determine if it meets certain criteria such as 256/BYLAYER, or GREEN, or between 8 and 249, etc.
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
i take your point and maybe that's what it means - although, that pretty much is the nature of .net, i.e. a designer creates and edits objects on-screen whereas a programmer manipulates a [.dwg] database; so i might be forgiven to think that pointing out to developers that not everything in the database has a visible reflection offers itself to mis-interpretation. thanks though