(vla-put-plotstyleName mylayer "100%") not working

Gordon Price

Usenet Archive
Joined
Jul 14, 2003
Messages
203
Reaction score
0
I am trying to use Reactors to manage layers for various object types. I understand that you can't/don't want to use (command ...) in a reactor, so I am trying to figure out how to build layers with activeX instead. In the code below, everything works but the last part. There is a PlotStyle called 100% available, I can set it manually. If I do and use a get to look at the plotstyle I get 100%. I also looked and the PlotStyleName Property is just supposed to be a string. Any suggestions?

Thanks,
Gordon

(setq mylayer (vla-add (vla-get-layers (vla-get-activeDocument (vlax-get-acad-object))) "A-ANNO-TEXT")) (vla-put-color mylayer "30") (vla-put-lineweight mylayer acLnWt018) (vla-put-plotstyleName mylayer "100%")
 
Gordon,
I don't know if this will help or not, but if I understand you correctly, I believe I've noticed the same strange behavior - i.e. put-plotstylename not working when I *KNOW* it's in there.

What I found that *seems* to do the trick (so far at least), is to set the CPLOTSTYLE sysvar to *that* plotstylename, then set it back to whatever it was to start with. Thereafter, AutoCAD seems to be okay with it. Stupid workaround, IMO, but it's at least something.

Has anyone else noticed this and found a better way to handle it?

hth,
David Kozina

I am trying to use Reactors to manage layers for various object types. I understand that you can't/don't want to use (command ...) in a reactor, so I am trying to figure out how to build layers with activeX instead. In the code below, everything works but the last part. There is a PlotStyle called 100% available, I can set it manually. If I do and use a get to look at the plotstyle I get 100%. I also looked and the PlotStyleName Property is just supposed to be a string. Any suggestions?

Thanks,
Gordon

(setq mylayer (vla-add (vla-get-layers (vla-get-activeDocument (vlax-get-acad-object))) "A-ANNO-TEXT")) (vla-put-color mylayer "30") (vla-put-lineweight mylayer acLnWt018) (vla-put-plotstyleName mylayer "100%")
 
PS - something I was gonna check on this is if (vlax-put-property obj 'PlotStyleName ...) suffered from the same fruitiness as (vla-put-plotstylename...) - or if it worked 100% better. ;)
 

Latest threads

Back
Top