Code Red > AutoLISP (Vanilla / Visual)

Insert block and ask for scale

<< < (2/5) > >>

like_citrus:
I'm struggling with the Dimension.
Rather than changing "Dim scale overall", would it be easier to change the following: "Arrow size", "Text height", "Text offset", "Dim scale linear".
Or alternatively, is there a setting in AutoCAD which when scaling dimensions, it changes the appearance. Or a setting in Dimension Styles?

BIGAL:
Like most styles you could get at the style prior to adding say a dimension, a simpler way may be to use entmake a dimension where you set the sizes, not tested but entmake often ignores current settings.

like_citrus:
OK thanks, how can that be done using LISP.

BIGAL:
If you use VL you can get at a lot of the dimension variables eg (vla-put-arrowheadsize 10)

So if you wanted the arrows to be twice the size (setq arrow (* 2.0 (vla-get-arrowheadsize obj)) (vla-put-arrowheadsize arrow)

Make the dim command etc then use (setq obj (vlax-ename->vla-object  (entlast)) to get the last object the Dimension.

Use Dumpit pick a dimension it will reveal the property names, then a get and put to change.

like_citrus:
Thanks I tried this to get started but still no good.
It actually stops other defuns in the same LISP file from running.


--- Code: ---(defun TestForDim (blkname)
    (command "_.-insert" (substr (strcat blkname "-" (menucmd "m=$(edtime,0,yymoddhhmmss)") "=" blkname) (+ (vl-string-position (ascii "_") blkname 1) 2)) pause 1 "" 0)
(setq obj (vlax-ename->vla-object  (entlast))   
(setq arrow (* 2.0 (vla-get-arrowheadsize obj)) (vla-put-arrowheadsize arrow)
    (command "explode" "last")
)
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version