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

Discussion in 'AutoCAD' started by Gordon Price, Jan 12, 2004.

  1. Gordon Price

    Gordon Price Guest

    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 Price, Jan 12, 2004
    #1
  2. Gordon Price

    David Kozina Guest

    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%")
     
    David Kozina, Jan 12, 2004
    #2
  3. Gordon Price

    David Kozina Guest

    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. ;)
     
    David Kozina, Jan 12, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.