Setting a new Edge Color and restoring within a script
All  1  2-3

Previous
Next
 From:  Michael Gibson
10401.2 In reply to 10401.1 
Hi Ed, so if I understand properly you'd do something like this to set the edge display to a specific color and then back again:


var prev_color_mode = moi.view.edgeColorMode;
var prev_fixed_color = moi.view.edgeFixedColor;

moi.view.edgeColorMode = "FixedColor";

var r = 255;
var g = 0;
var b = 0;

moi.view.edgeFixedColor = (r << 16) | (g << 8) | b;

moi.ui.alert( 'edges are red' );

moi.view.edgeColorMode = prev_color_mode;
moi.view.edgeFixedColor = prev_fixed_color;



I'm not exactly following what you want for the style part, but yes it is possible to look for a style using:

var style = moi.geometryDatabase.findStyle( 'stylename', true /* Create if not found */ );

Let me know if you need more details.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  ed (EDDYF)
10401.3 In reply to 10401.2 
Thanks very much Michael! - That looks like everything I need to move forward.

I've done a lot of searching on the Moi forum and Moi script resource sites, plus studied many existing scripts, and had not come across the statements you provided. Now I have all the puzzle pieces :)

Ed Ferguson
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1  2-3