Setvar DimStyle problems

Discussion in 'AutoCAD' started by Gordon Price, Nov 15, 2004.

  1. Gordon Price

    Gordon Price Guest

    I have a dimstyle that I want to set current with code. The dimstyle is
    called XXX, and when I set it current with the dialog, then do...
    Command: (getvar "dimstyle")
    I get this returned...
    "XXX"
    So, if I set STANDARD current, and do this...
    (setvar "dimstyle" "XXX")
    I get this returned
    ; error: AutoCAD variable setting rejected: "dimstyle" "XXX"

    I also tried...
    (vla-setvariable (vla-get-activedocument (vlax-get-acad-object)) "dimstyle"
    "XXX")
    I got this returned...
    ; error: Automation Error. Error setting system variable

    All of this in ADT 3.3. Anyone have any thoughts? Is there a better way to
    do this? My goal is to put some stuff in S::Startup so that the correct
    DimStyles are loaded into every drawing at startup.

    Best,
    Gordon
     
    Gordon Price, Nov 15, 2004
    #1
  2. He beat me to it -- Dimstyle is read-only, so you have to use a command to
    set it, not (getvar).

    You can do
    (command "dimstyle" "r" "xxx")
     
    Kent Cooper, AIA, Nov 15, 2004
    #2
  3. Gordon Price

    Gordon Price Guest

    Duh! Some things just make you smack your head.
    Sounds like a job for Vlisp & activeX. Off we go to the manuals.

    Thanks,
    Gordon
     
    Gordon Price, Nov 16, 2004
    #3
  4. You might check back a few days for a post
    started by Marcel Goulet.
     
    Jason Piercey, Nov 16, 2004
    #4
  5. Gordon Price

    Gordon Price Guest

    Yep, taking the chickens way out and doing that for now. I will try Vlisp
    activeX later.

    Best,
    Gordon
     
    Gordon Price, Nov 16, 2004
    #5
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.