CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.091.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator. New AutoCAD 2026 commands and variables.
Plex.Earth connects AutoCAD and Google Earth
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic Closedline space factor for MULTILEADERS

 Post Reply Post Reply
Author
Macieto View Drop Down
Groupie
Groupie


Joined: 25.Feb.2009
Location: Poland
Using: ACAD MEP
Status: Offline
Points: 23
Direct Link To This Post Topic: line space factor for MULTILEADERS
    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
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post 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.
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
Macieto View Drop Down
Groupie
Groupie


Joined: 25.Feb.2009
Location: Poland
Using: ACAD MEP
Status: Offline
Points: 23
Direct Link To This Post 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.


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
Back to Top
HAWDesigner View Drop Down
Senior Member
Senior Member


Joined: 04.Aug.2008
Location: United States
Using: AutoCAD R14, AutoCAD 2009, AutoCAD 2010
Status: Offline
Points: 310
Direct Link To This Post 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 APPLOAD 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
Back to Top
Macieto View Drop Down
Groupie
Groupie


Joined: 25.Feb.2009
Location: Poland
Using: ACAD MEP
Status: Offline
Points: 23
Direct Link To This Post 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 APPLOAD 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
Back to Top
malvar View Drop Down
Newbie
Newbie


Joined: 02.Mar.2011
Location: Philippines
Using: AutoCAD 2009/10
Status: Offline
Points: 4
Direct Link To This Post 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
Back to Top
Macieto View Drop Down
Groupie
Groupie


Joined: 25.Feb.2009
Location: Poland
Using: ACAD MEP
Status: Offline
Points: 23
Direct Link To This Post 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
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,188 seconds.