Print Page | Close Window

line space factor for MULTILEADERS

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=5396
Printed Date: 31.May.2026 at 23:30


Topic: line space factor for MULTILEADERS
Posted By: Macieto
Subject: line space factor for MULTILEADERS
Date Posted: 02.Mar.2011 at 16:39
Hi,
Does anybody know how to set globaly "line space factor" for every new MULTILEADERS?

Is there any system variable for it?
I know that MTEXT has system variable for it called TSPACEFAC, but I cant find anything for MLEADERS

BR


-------------
ACAD MEP 2009 EN SP3



Replies:
Posted By: John Connor
Date Posted: 02.Mar.2011 at 18:08
You might find this thread from the AUGI Discussion Forums to be of interest.  The person who started it had basically the same question as you.
http://forums.augi.com/showthread.php?t=90762" rel="nofollow - http://forums.augi.com/showthread.php?t=90762


-------------
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>



Posted By: Macieto
Date Posted: 02.Mar.2011 at 22:52
Originally posted by John Connor John Connor wrote:

You might find this thread from the AUGI Discussion Forums to be of interest.  The person who started it had basically the same question as you.
http://forums.augi.com/showthread.php?t=90762" rel="nofollow - http://forums.augi.com/showthread.php?t=90762


Thanks for the advice John Connor but I quess that it's a little bit to tricky for me - I dont understand that topic from AUGI

What does that code from AUGI website do?

(defun mleaderspfac    (/ obj objent objentdata vlaobjent)
(if (setq obj (ssget "_L"))
(progn
(setq objent (ssname obj 0)
objentdata (entget objent)
vlaobjent (vlax-ename->vla-object objent)
) ;_ end of setq
(if (/= (cdr (assoc 290 objentdata)) 0)
(if (= (vlax-get-property vlaobjent 'TextLineSpacingStyle) 1)
(progn
(vlax-put-property vlaobjent 'TextLineSpacingStyle 2)
(vlax-put-property vlaobjent 'TextLineSpacingFactor 1)
) ;_ end of progn
) ;_ end of if
) ;_ end of if
) ;_ end of progn
) ;_ end of if
) ;_ end of defun

(if (not Command_Ending_Reactor)
(setq Command_Ending_Reactor
(vlr-command-reactor
nil
'((:vlr-commandended
.
Command_Ended_Command
)
)
) ;_ end of vlr-command-reactor
) ;_ end of setq
() ;_ the reactor is already loaded
)
(defun Command_Ended_Command
(In_ReactorName In_Command / LayObj tess)
(if (= (car In_Command) "MLEADER")
(mleaderspfac)
) ;_ end if
)


I have uploaded that code from lsp file and than run MLEADER but nothing happened?
How should I use that code>?


-------------
ACAD MEP 2009 EN SP3


Posted By: HAWDesigner
Date Posted: 02.Mar.2011 at 23:24
Hi Macieto, what that is, is LISP code. Basically, it's a Macro on steroids. When run, it tells AutoCAD what to do.

If you save that code to a file, you can load it and run it.

In order to do that, you have to save it (using Notepad) to a file named "mleaderspfac.lsp" in the folder where the other .LSP files reside (usually C:\Program Files\AutoCAD 2009\Support\ - or whatever your version of AutoCAD is).

To load the program in AutoCAD, you type [CMD]APPLOAD[/CMD] and select the file you saved.

To RUN the program, at the commandline, type MLEADERSPFAC.


Good Luck!!


-------------
--
R. Williams
AutoCAD 2010 Certified Professional
<!-- If all else fails hit F1 -->
<<AutoCAD 2009


Posted By: Macieto
Date Posted: 03.Mar.2011 at 08:18
Originally posted by HAWDesigner HAWDesigner wrote:

Hi Macieto, what that is, is LISP code. Basically, it's a Macro on steroids. When run, it tells AutoCAD what to do.

If you save that code to a file, you can load it and run it.

In order to do that, you have to save it (using Notepad) to a file named "mleaderspfac.lsp" in the folder where the other .LSP files reside (usually C:\Program Files\AutoCAD 2009\Support\ - or whatever your version of AutoCAD is).

To load the program in AutoCAD, you type [CMD]APPLOAD[/CMD] and select the file you saved.

To RUN the program, at the commandline, type MLEADERSPFAC.


Good Luck!!


Thanks HAWDesigner,
I know how to load a routine, so that was not a problem
Originally posted by Macieto Macieto wrote:

I have uploaded that code from lsp file and than run MLEADER but nothing happened?
How should I use that code>?


The problem is that it doesnt work, and I really dont think that afeter apploading that mleaderspfac.lsp I should type mleaderspfac, because I suppose that  mleaderspfac is somehow reactor for command mleader.
But it basically doesnt work whatever I will type:
1) when I type mleader than I can draw mleader but I can see no difference
2) when I type mleaderspfac than acad tells
Command: mleaderspfac
Unknown command "MLEADERSPFAC".  Press F1 for help.


I suppose that somewhere in this code is a place  responsible for placing every new mleader with specified line space factor. Is it this part?

(vlax-put-property vlaobjent 'TextLineSpacingStyle 2)
(vlax-put-property vlaobjent 'TextLineSpacingFactor 1)


What I want to achieve is to draw MLEADERS with specified line space factor, not with default line space factor =1.





-------------
ACAD MEP 2009 EN SP3


Posted By: malvar
Date Posted: 03.Mar.2011 at 09:23
Hi Macieto

It seems the lisp routine you are loading is a sub-routine of a bigger lisp program. you can load and call the command with open-close brackets like this: (mleaderspfac). 

If you want to call the command directly, insert in the lisp routine "c:" before the function name, like this:
    (defun c:mleaderspfac (/ obj objent....
Once you made this in notepad, save it as lisp file (.lsp extension)
Then load the file in the command line with "Appload" and pick the file you saved for loading.
You should now be able to call the "mleaderspfac" directly at the command line
Hope this helps


Posted By: Macieto
Date Posted: 03.Mar.2011 at 10:21
Ok, I have finally figured it out!

I've just changed "1" for "0.9" and reactor works great

(vlax-put-property vlaobjent 'TextLineSpacingStyle 2)
(vlax-put-property vlaobjent 'TextLineSpacingFactor 0.9)
Thanks people! :-)


-------------
ACAD MEP 2009 EN SP3



Print Page | Close Window