Jump to content

recalling info after dimscale


JPlanera

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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! :D Thanks for the tip Lee. You have quite a reputation around these parts.... Kudos to you, my friend!! 8):thumbsup:

Link to comment
Share on other sites

Thanks JPlanera :)

 

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

 

Vanilla:

(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:

(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)
)

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

For multiple dims you might consider stepping through a SelectionSet:

 

(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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...