+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Super Member JPlanera's Avatar
    Computer Details
    JPlanera's Computer Details
    Operating System:
    Win7 x64
    Computer:
    Dell T7400
    CPU:
    (4) Intel Xeon CPU X5272 @ 3.4GHz
    RAM:
    8G
    Graphics:
    NVIDIA Quadro FX 570 & RADEON X6000
    Primary Storage:
    80G main
    Secondary Storage:
    1TB ext
    Monitor:
    (3) DELL 21" wide
    Using
    Mechanical 2012
    Join Date
    Sep 2010
    Location
    Chicago
    Posts
    526

    Default recalling info after dimscale

    Registered forum members do not see this ad.

    I'm writing a LISP that uses DIMSCALE. My dimensions have tolerances, and info in Text Override, and none are alike. As soon as DIMSCALE is set, I lose all that info... How would I be able to recall this information from the selection set?? I cant seem to figure it out

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,710

    Default

    If using Vanilla, Text Override is DXF Code 1, else in VL it's the TextOverride Property.

    Tolerances are another issue, which you'll have to look up in the VLIDE Help Docs - there are many properties/dxf codes.
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  3. #3
    Super Member JPlanera's Avatar
    Computer Details
    JPlanera's Computer Details
    Operating System:
    Win7 x64
    Computer:
    Dell T7400
    CPU:
    (4) Intel Xeon CPU X5272 @ 3.4GHz
    RAM:
    8G
    Graphics:
    NVIDIA Quadro FX 570 & RADEON X6000
    Primary Storage:
    80G main
    Secondary Storage:
    1TB ext
    Monitor:
    (3) DELL 21" wide
    Using
    Mechanical 2012
    Join Date
    Sep 2010
    Location
    Chicago
    Posts
    526

    Default

    Quote Originally Posted by Lee Mac View Post
    If using Vanilla, Text Override is DXF Code 1, else in VL it's the TextOverride Property.

    Tolerances are another issue, which you'll have to look up in the VLIDE Help Docs - there are many properties/dxf codes.
    Interesting... I am investigating this now. As I am a self taught code writer, a simple example would do wonders! Thanks for the tip Lee. You have quite a reputation around these parts.... Kudos to you, my friend!!

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,710

    Default

    Thanks JPlanera

    Here's a small example to retrieve the Text Override for a dimension entity:

    Vanilla:
    Code:
    (defun c:test1 ( / ent )
    
      (if
        (and
          (setq ent (car (entsel "\nSelect Dimension: ")))
          (wcmatch (cdr (assoc 0 (entget ent))) "*DIMENSION")
        )
    
        (alert (strcat "Text Override:\n" (cdr (assoc 1 (entget ent)))))
      )
    
      (princ)
    )
    Visual:
    Code:
    (defun c:test2 ( / ent )
    
      (if
        (and
          (setq ent (car (entsel "\nSelect Dimension: ")))
          (wcmatch (cdr (assoc 0 (entget ent))) "*DIMENSION")
        )
    
        (alert (strcat "Text Override:\n" (vla-get-TextOverride (vlax-ename->vla-object ent))))
      )
    
      (princ)
    )
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  5. #5
    Super Member JPlanera's Avatar
    Computer Details
    JPlanera's Computer Details
    Operating System:
    Win7 x64
    Computer:
    Dell T7400
    CPU:
    (4) Intel Xeon CPU X5272 @ 3.4GHz
    RAM:
    8G
    Graphics:
    NVIDIA Quadro FX 570 & RADEON X6000
    Primary Storage:
    80G main
    Secondary Storage:
    1TB ext
    Monitor:
    (3) DELL 21" wide
    Using
    Mechanical 2012
    Join Date
    Sep 2010
    Location
    Chicago
    Posts
    526

    Default

    No, thank you!

    Vanilla code works fine.

    I assume this would be different for multiple dimensions?
    Can I use the same format then, to recall tolerances?

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,710

    Default

    For multiple dims you might consider stepping through a SelectionSet:

    Code:
    (defun c:test3 ( / i ss ent lst )
    
      (if (setq i -1 ss (ssget '((0 . "*DIMENSION"))))
        (progn
          (while (setq ent (ssname ss (setq i (1+ i))))
            (setq lst (cons (cdr (assoc 1 (entget ent))) lst))
          )
          (print (reverse lst))
        )
      )
    
      (princ)
    )
    Tolerances are another issue, I would think it is easier to deal with them using VL, but to be honest, I've not dealt with Tolerances before so I'd have to dig around with the DXF info first.

    Have a look at this reference here, and also the VLIDE Help Docs on the properties of a VLA Dimension Object.

    Lee
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  7. #7
    Super Member JPlanera's Avatar
    Computer Details
    JPlanera's Computer Details
    Operating System:
    Win7 x64
    Computer:
    Dell T7400
    CPU:
    (4) Intel Xeon CPU X5272 @ 3.4GHz
    RAM:
    8G
    Graphics:
    NVIDIA Quadro FX 570 & RADEON X6000
    Primary Storage:
    80G main
    Secondary Storage:
    1TB ext
    Monitor:
    (3) DELL 21" wide
    Using
    Mechanical 2012
    Join Date
    Sep 2010
    Location
    Chicago
    Posts
    526

    Default

    Registered forum members do not see this ad.

    I will look over this info. Thank you very much for the assistance!

Similar Threads

  1. Recalling custom Commands In Ribbon
    By Grenco in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 7th Jun 2010, 09:14 pm
  2. Dimscale
    By Scoobydoo in forum AutoCAD General
    Replies: 6
    Last Post: 8th Sep 2009, 12:44 am
  3. VBA and dimscale
    By gazzalp in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 13th Jan 2009, 11:04 pm
  4. Lisp For Storing And Recalling Layer And Osnap
    By mondomojo1969 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 19th Feb 2008, 09:44 pm
  5. Dimscale??
    By wastewater in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 22nd Jan 2007, 11:15 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts