DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Select an entity with coords ?

Started by deydope, October 17, 2017, 12:12:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deydope

Hi,

I have actually a problem, i need to get the color of an entity. I can select it with pointselect but i didn't find a way to get the color.

If someone have a solution it will be great :)

thanks for your time and sorry for bad english

deydope

I finally found a way to do this with the pointselect/getselect statement.
sorry for inconvenience

For those who are interested:
(It works on a 2d plane but i think it's gonna be working an 3d plane too)

sys(80) = 0
            >PointSelect
            {
                <PointXYZ [x2 + 70, y3]
                <Type 0
            }
            if sys(80) <> 0 then
                getselect sys(80), selected
                entity selected
                if sys(331) = 0 and sys(332) = 0 and sys(333) = 255 then
                    MESSAGE "Entity finded"
                endif
            endif

Lar

#2


Quote from: deydope on October 17, 2017, 12:25:53 AM
                    MESSAGE "Entity finded"
MESSAGE "Entity found"

;)


Actually, 331, 332 and 333 are the colors of the cursor (mouse), not the entity color.


When you use the 'entity' statement, the entity properties are usually in the 90's, but I guess the color properties came along later. They are in the 290's...

if sys(80)<>0 then
getselect sys(80), selected
entity selected
if sys(290) = 0 and sys(291) = 0 and sys(292) = 255 then      'if blue...
MESSAGE "Entity found"
else
MESSAGE "Entity not found"           ' this is not necessary but without it the macro would do nothing if the entity is not blue...
endif
endif



Note: when I copied your code and pasted into Notepad the spaces at the start of each were causing errors so I had to get rid of them.


Lar