Radiuses & Diameter Dimensions

Discussion in 'AutoCAD' started by juno, Mar 18, 2005.

  1. juno

    juno Guest

    I hate the VBA way of creating dimensions (without ghosting). So I would like to utilize AutoCAD dimensions but I would like to modify the settings per dimension before the user inserts them into the drawing. For instance I would like to change the Dim Suffix.

    I am not even sure if that is possible, if not then may be I can change the dimension after the insertion.

    What do you think? Any help, advice and snippet of code would be appreciated.

    Thank you in advance,
    juno, Mar 18, 2005
  2. If your planning on using the sendcommand than
    you could add xData to the dims which represents
    the prefix and suffix overides. Don't know if you
    could add it before hand with the sendcommand.
    Must be a way. Anyone?

    Check the xData on dims with overides and you see
    something like the following. I did a quick test and
    it seems to work fine.


    Dim DataType(7) As Integer
    Dim Data(7)

    DataType(0) = 1001: Data(0) = "ACAD"
    DataType(1) = 1000: Data(1) = "DSTYLE"
    DataType(2) = 1002: Data(2) = "{"
    DataType(3) = 1070: Data(3) = 3
    DataType(4) = 1000: Data(4) = "Prefix<>Suffix"
    DataType(5) = 1070: Data(5) = 288
    DataType(6) = 1070: Data(6) = 1
    DataType(7) = 1002: Data(7) = "}"
    Paul Richardson, Mar 18, 2005
  3. If you already have the dims placed than
    you can just use the vba methods for
    prefix and suffix...much cleaner and eaiser.
    Paul Richardson, Mar 18, 2005
  4. juno

    juno Guest

    Thank you Paul for the answer,

    I was able to accomplish what I was trying to do by changing the variable [ThisDrawing.SetVariable "dimpost", ""]. But I am interested to get to understand how to use you method. Can you please elaborate on what do I do next after I set up the arrays.

    juno, Mar 21, 2005
  5. Juno, AutoCAD stores the overrides as xData with your object. We can
    also store Data in objects with xData, via group codes i.e...

    1001: Name to Call xData
    1000: string data
    1040: double data



    Dim someDouble1 As Double: someDouble1 = 25.5
    Dim someDouble2 As Double: someDouble2 = 50.5
    Dim DataType(4) As Integer
    Dim Data(4), outData, outValue

    DataType(0) = 1001: Data(0) = "NameOfData"
    DataType(1) = 1000: Data(1) = "someString1"
    DataType(2) = 1000: Data(2) = "someString2"
    DataType(3) = 1040: Data(3) = someDouble1
    DataType(4) = 1040: Data(4) = someDouble2
    yourObject.SetXData DataType, Data
    yourObject.GetXData "NameOfData", outData, outValue
    Paul Richardson, Mar 21, 2005
  6. Check out Juerg's post "Extended Entity Data" in the
    Customization Group, much more info...

    Paul Richardson, Mar 22, 2005
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.