CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > CoCreate Modeling
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 06-12-2014, 11:22 PM
johrndorf's Avatar
johrndorf johrndorf is offline
Registered User
 
Join Date: Jun 2006
Posts: 14
Question 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?
Reply With Quote
  #2  
Old 08-06-2014, 07:31 AM
Sinan Sinan is offline
Registered User
 
Join Date: Feb 2003
Location: Budapest,Tallinn,Minsk
Posts: 42
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
Reply With Quote
  #3  
Old 10-05-2014, 11:48 PM
johrndorf's Avatar
johrndorf johrndorf is offline
Registered User
 
Join Date: Jun 2006
Posts: 14
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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:18 PM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.