|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
#1
|
||||
|
||||
Function to inquire color of 2D geometry on workplane
Currenly I am looking for a IKIT function to inquire the color of a line in a workplane. I did not find any. there is a sd-inq-edge-color but it only returns the color of 3D edges. For 2D geometry on a WP it delivers nil. Also the command edge_2d_prop does not return anything but nil.
Does anybody know a command or function that returns the color value? |
#2
|
|||
|
|||
Re: Function to inquire color of 2D geometry on workplane
Hello ,
I was also looking already long time for a solution for this problem. Finally I gave up and made a work-around and it works well - at least for my purpose. Maybe it can also help you. Even though some file access is involved, it's very fast because the files are kept very small. Lets assume, your 'edge of interest' is 'edge1' - memorize your current wp - create a new wp - create a dummy line 'temp1' on this wp and copy the color value of 'edge' to the new created line (sd-call-cmds (EDGE_2D_PROP temp1 :display_ui :the_edge :copy_from edge1 :apply :close)) - store WP as mi to a dummy file (setf dummyfile (sd-gen-unique-filename (sd-inq-temp-dir) )) (sd-call-cmds (MI_OUT (sd-inq-curr-wp) :FILENAME dummyfile )) - open the dummy MI-file - read until you find the keyword 'LIN' - dummy read next line - read next line as the requested color value - delete dummy-file, delete dummy wp - set back your old current wp The only problem you should solve is the color coding in MI-File. 0 ... black 1 ... red 2 ... green etc .. which is kind of strange and does not follow the rgb rules. Hope I could help you Sinan |
#3
|
||||
|
||||
Re: Function to inquire color of 2D geometry on workplane
Thank you Sinan for the reply. Yes of course, that would work, good idea. Reminds me of old ME10 times when we had to get data from MI files for performance reasons.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|