Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I would like to use ddedit to change a dimension to a letter so I can ask a question.
Michael Fyfe
Solved! Go to Solution.
I would like to use ddedit to change a dimension to a letter so I can ask a question.
Solved! Go to Solution.
Not really understand you. But try this:
(defun c:OverrideDim ( / ss i ent bent ed txt pos) (if (and (setq ss (ssget "_:L" '((0 . "DIMENSION")))) (setq txt (getstring T "\nSpecify text to override dims: ")) ) (repeat (setq i (sslength ss)) (setq ent (ssname ss (setq i (1- i)))) (entmod (subst (cons 1 txt) (assoc 1 (entget ent)) (entget ent))))) (princ) )
Or do you actually want to type a letter to call the ddedit command? In that case, add the ALIAD to the ACAD.PGP file.
Thanks
What I'm doing is making a lisp program to make an angle iron frame with holes. In the first part of the program i'm getting the out side dimension of the angle iron frame say 36" x 12". Then I putting that 36 x 12 rectangle on the screen with the dimension I just got. Now I have to get the hole locations. So I put a dimension in this drawing from center to say 3" to the left of center. Its this dimension that I would like to change or edit to be a letter so I can use this latter to ask a question to get the dimension to locate the next hole. Then use (command ".erase" "L" "") and then use the same process to get the next hole and so on.
@mike2334 wrote:
.... I have to get the hole locations. So I put a dimension in this drawing from center to say 3" to the left of center. Its this dimension that I would like to change or edit to be a letter so I can use this latter to ask a question to get the dimension to locate the next hole. Then use (command ".erase" "L" "") ....
Study the Dimension command prompt sequence -- you can feed in a "_text" option and give it the letter in place of the measured-distance text, in the process of drawing it, rather than editing it afterwards.
But post an image or sample drawing illustrating what you want to end up with, and what kind of User input is necessary to determine it. I suspect there's probably a much cleaner way to do it than to draw a temporary Dimension only to almost immediately Erase it.
(defun C:123 (/)
(setvar "dimscale" 8)
(setvar "osmode" 0)
(setvar "dimzin" 8)
(setq p1 (list 10.00 10.00))
(setq p2 (polar(polar p1 0 36)(/ pi 2)22))
(Command ".Rectangle" p1 p2)
(Command ".Dimlinear"(polar p1 0 18)(polar p1 0 21)(polar p1 (* pi 1.5)6 ))
(command ".Zoom" "A")
;At this point I would like to change the 3" dim to a letter using lisp (ddedit or something) if I can?
;(initget 7)
;(setq bsize (getreal "\n Enter size {A}: "))
(command ".text" (polar p1 (* pi 1.5)12) 1.5 0 "At this point I would like to change the 3 inch dim")
(command ".text" (polar p1 (* pi 1.5)15) 1.5 0 "to a letter using lisp {ddedit or something} if I can?")
(command ".Zoom" "A")
(princ)
)
you do not need to use ddedit (altough you can) instead use the option "text" of dimlinear command and feed any text value you want?!
change this:
(Command ".Dimlinear"(polar p1 0 18)(polar p1 0 21)(polar p1 (* pi 1.5)6 ))
to this:
(Command ".Dimlinear"(polar p1 0 18)(polar p1 0 21) "text" "A" (polar p1 (* pi 1.5) 6))
another way to to that is to get the entity database of the dimension and set a new text value but i do not want to confuse you right now with that.
moshe
Easy enough version to set it backwards, to the last object created
(setpropertyvalue (entlast) "DimensionText" (getstring "\nLetter: "))
...for acad 2011+