Author Topic: help with mleader lisp  (Read 935 times)

0 Members and 1 Guest are viewing this topic.

PM

  • Guest
help with mleader lisp
« on: March 26, 2022, 05:34:22 AM »
Hi, I use for dimensions this lisp code. The code draw the dimension by scale,

In the same way, I want to inset a mleder style like the attachment drawing  and  draw mleader in style TopoCad like the attachment drawing using a lisp code like dimARX.lsp

I dont know how to set DIMTXT and DIMASZ for the mleader

Code - Auto/Visual Lisp: [Select]
  1.   (setvar 'DIMTXT (* scl 0.00175))          ; Text Height
  2.   (setvar 'DIMASZ (* scl 0.001))  
  3.  



Code - Auto/Visual Lisp: [Select]
  1. (defun c:dimARX (/ scl)
  2.  
  3.  
  4. (if (NOT (tblsearch "dimstyle" "ARX"))
  5.   (vl-exit-with-error (alert "To Dimstyle ARX does not exist !!!!"))
  6.   ) ; end if
  7.  
  8.   (command "_layer" "_m" "DIM" "_c" "7" "" "_lw" "0.30" "" "") ;CREATE NEW LAYER
  9.   (setvar "CLAYER" "DIM")
  10.   (command "-DIMSTYLE" "R" "ARX")
  11.  (setq scl (getint "\n select new scale  (50,100,200,250,500,etc) :"))
  12.   (setvar 'DIMTXT (* scl 0.00175))          ; Text Height
  13.   (setvar 'DIMASZ (* scl 0.001))            ; Arrow Size
  14.   (setvar 'DIMGAP (* scl 0.001))            ; Text offset
  15.   (setvar "celtscale" 1)                    ; linetype scale
  16.   (command "dimaligned")
  17. )
  18.  
  19.  
  20.  





Thanks
« Last Edit: March 27, 2022, 05:05:26 AM by PM »

PM

  • Guest
Re: help with mleader lisp
« Reply #1 on: March 27, 2022, 04:58:27 AM »
for scale 1:200 gives me this error and the code stop

Code: [Select]
Command: ; error: AutoCAD variable setting rejected: TEXTHEIGHT 0.5

Can any one help me to fix it ?

Code - Auto/Visual Lisp: [Select]
  1. (defun c:MLD2(/ scl)
  2.   (command "_layer" "_m" "MLEADER" "_c" "7" "" "")
  3.   (setvar "cmleaderstyle" "TopoCad")
  4.  (setq scl (getint "\n select new scale  (50,100,200,250,500,etc) :"))
  5.   (setvar 'TextHeight  (* scl 0.0025))         ; Text Height
  6.   (setvar 'ArrowSize   (* scl 0.001))            ; Arrow Size
  7.   (setvar 'LandingGap  (* scl 0.001))            ; Text gap
  8.   (setvar "celtscale" 1)                    ; linetype scale
  9.   (command ".mleader"  "" "")
  10. )
  11.  
  12.  
  13.  

Thanks
« Last Edit: March 27, 2022, 05:56:30 AM by PM »

PM

  • Guest
Re: help with mleader lisp
« Reply #2 on: March 27, 2022, 12:45:45 PM »
Any ideas? I believe that something is missing in this code but i can not find it