Display full version of the post: line space factor for MULTILEADERS

Macieto
02.03.2011, 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 MLEADERSBR

John Connor
02.03.2011, 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

Macieto
02.03.2011, 22:52

[QUOTE=John Connor]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[/QUOTE]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 AUGIWhat does that code from AUGI website do?[code](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)[/code]I have uploaded that code from lsp file and than run MLEADER but nothing happened?How should I use that code>?

HAWDesigner
02.03.2011, 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!!

Macieto
03.03.2011, 08:18

[QUOTE=HAWDesigner]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!!
[/QUOTE]Thanks HAWDesigner,I know how to load a routine, so that was not a problem[QUOTE=Macieto]I have uploaded that code from lsp file and than run MLEADER but nothing happened?How should I use that code>?[/quote]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 [code]Command: mleaderspfacUnknown command "MLEADERSPFAC".  Press F1 for help.[/code]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?[code](vlax-put-property vlaobjent 'TextLineSpacingStyle 2)(vlax-put-property vlaobjent 'TextLineSpacingFactor 1)[/code]What I want to achieve is to draw MLEADERS with specified line space factor, not with default line space factor =1.

malvar
03.03.2011, 09:23
Hi MacietoIt 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 lineHope this helps

Macieto
03.03.2011, 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! :-)