vla-add & vlax-put.. (for dims)

Discussion in 'AutoCAD' started by C Witt, Jul 13, 2004.

  1. C Witt

    C Witt Guest

    (setq dimCollection (vla-get-dimstyles (vla-get-activedocument
    (vlax-get-acad-object))))
    (setq object (vla-add dimCollection "dimstylename"))
    (vlax-put object dimvar? "varsetting")

    I want to create and modify my dim styles via the above method.. the
    catch.. i don't know what i need to put for the "dimvar?" part..

    basic cad it would be "dimtxt".. and so forth.. but that does not work
    here.. help please.
     
    C Witt, Jul 13, 2004
    #1
  2. C Witt

    C Witt Guest

    I can't find any documentation on:
    vla-copyfrom
    vla-put-activedimstyle (just sets current?)

    what do they do?
     
    C Witt, Jul 14, 2004
    #2
  3. Set all the variables you need for a particular dimstyle

    Add the desired dimstlye name to the collection

    vla-copyfrom using the new dimstyle object and the current
    document object as arguments.

    vla-put-activedimstyle using the same arguments as above
    but in reverse order.
     
    Jason Piercey, Jul 14, 2004
    #3
  4. C Witt

    C Witt Guest

    nevermind.

    thank you

     
    C Witt, Jul 14, 2004
    #4
  5. C Witt

    andywatson Guest

    C,
    At the command line in AutoCAD, type "VBAIDE".
    If you do not see a window titled "Object Browser", hit F2 to open it.
    In the left pane of the Object Browser, scroll down to and click on AcadDimension.
    In the right pane, scroll down to and click on TextGap (as an example).
    Right-click on TextGap and select Help.

    This page describes the TextGap property of an AcadDimension object, how to retrieve it, and how to set it in VBA.
    You see the signature "Object.TextGap", followed by an explanation of what objects have the TextGap property, in this case, all dimension objects.
    You also will see the corresponding lisp or system variable toward the bottom, in this case, DIMGAP.

    You can use the Object Browser to see all objects and their methods (to invoke) and properties (to put or get).
     
    andywatson, Jul 14, 2004
    #5
  6. You're welcome.
     
    Jason Piercey, Jul 14, 2004
    #6
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.