Does anyone know where and how in the lisp routine the values need to change in order to reduce the gaps before and after the weld size in weld.lsp (http://forums.autodesk.com/autodesk/attachments/autodesk/407/9467/1/WELDS.ZIP) ...essentially compacting the weld symbol a bit.
Thanks,
ADK
Solved! Go to Solution.
Solved by ajohnson. Go to Solution.
This portion of the code locates the text:
;; INSERT WELD SIZE, EFFECTIVE THROAT, PITCH-LENGTH, AND ROOT-DEPTH
;;
(if (/= weld_type_near 0)
(progn
(command "TEXT" "S" (getvar "DIMTXSTY") "TC"
(list (+ (car ref_pt) (* dim_scale (+ 3.0 (/ add_len 2.0)))) (- (cadr ref_pt) (* dim_scale 0.5)))
dim_scale "0" weld_throat_near
)
(command "TEXT" "S" (getvar "DIMTXSTY") "TL"
(list (+ (car ref_pt) (* dim_scale (+ 9.5 add_len))) (- (cadr ref_pt) (* dim_scale 0.5)))
dim_scale "0" pitch_near
)
(command "TEXT" "S" (getvar "DIMTXSTY") "TR"
(list (+ (car ref_pt) (* dim_scale (+ 4.5 (/ add_len 2.0)))) (- (cadr ref_pt) (* dim_scale 2.0)))
dim_scale "0" depth_near
)
)
)
Within the above, this portion sets the location of the weld_size:
(list (+ (car ref_pt) (* dim_scale (+ 3.0 (/ add_len 2.0)))) (- (cadr ref_pt) (* dim_scale 0.5)))
And this portion sets the X location of the text:
(+ (car ref_pt) (* dim_scale (+ 3.0 (/ add_len 2.0))))
The (car ref_pt) is the x base point for the text the the (* dim_scale (+ 3.0 (/ add_len 2.0))) is the distance from the ref_pt.
So you need to adjust the (* dim_scale (+ 3.0 (/ add_len 2.0)) term, probably changing the 3.0 to whatever works for positioning as needed...
I sort of reached this before the post but the weld reference line does not shrink with the text. the line length is somewhere in there but seem to be overlooking the location.@ajohnson wrote:This portion of the code locates the text:
;; INSERT WELD SIZE, EFFECTIVE THROAT, PITCH-LENGTH, AND ROOT-DEPTH
;;
(if (/= weld_type_near 0)
(progn
(command "TEXT" "S" (getvar "DIMTXSTY") "TC"
(list (+ (car ref_pt) (* dim_scale (+ 3.0 (/ add_len 2.0)))) (- (cadr ref_pt) (* dim_scale 0.5)))
dim_scale "0" weld_throat_near
)
(command "TEXT" "S" (getvar "DIMTXSTY") "TL"
(list (+ (car ref_pt) (* dim_scale (+ 9.5 add_len))) (- (cadr ref_pt) (* dim_scale 0.5)))
dim_scale "0" pitch_near
)
(command "TEXT" "S" (getvar "DIMTXSTY") "TR"
(list (+ (car ref_pt) (* dim_scale (+ 4.5 (/ add_len 2.0)))) (- (cadr ref_pt) (* dim_scale 2.0)))
dim_scale "0" depth_near
)
)
)
Within the above, this portion sets the location of the weld_size:
(list (+ (car ref_pt) (* dim_scale (+ 3.0 (/ add_len 2.0)))) (- (cadr ref_pt) (* dim_scale 0.5)))
And this portion sets the X location of the text:
(+ (car ref_pt) (* dim_scale (+ 3.0 (/ add_len 2.0))))
The (car ref_pt) is the x base point for the text the the (* dim_scale (+ 3.0 (/ add_len 2.0))) is the distance from the ref_pt.
So you need to adjust the (* dim_scale (+ 3.0 (/ add_len 2.0)) term, probably changing the 3.0 to whatever works for positioning as needed...
Hint: look at the get points method.
A trick to figuring out what the code is doing is to set a break point somewhere in the code prior to the point you think the issue lies, and then step through the code (key F8) and watch what happens on the screen. When you see the line drawn you want to change, you know that this is the section you need to fix.
If I did it all for you, what do you learn?