Jump to content

Recommended Posts

Posted

I have 5 tabs in one drawing and would like to change psltscale for all 5 tabs at one time instead of changing one at a time. Any suggestions? I saw these to code but I don't know how to use it. Please help :(

 

 

(foreach lay (layoutlist)(command "_LAYOUT" "_Set" lay "PSLTSCALE" 1))

 

or

(foreach lay (layoutlist)(command "_LAYOUT" "_Set" lay "PSLTSCALE" 0))estions? I

Posted

Just paste the code into the command line and hit enter :)

 

 
(foreach lay (layoutlist)(command "_LAYOUT" "_Set" lay "PSLTSCALE" 1))

 

Worked fine for me...

This it what the command line reported for each tab:

 

 
_LAYOUT
Enter layout option [Copy/Delete/New/Template/Rename/SAveas/Set/?] <set>: _Set
Enter layout to make current <TP4>: TP1 Restoring cached viewports - 
Regenerating layout.
Command: PSLTSCALE
Enter new value for PSLTSCALE <1>: 1
Command:

Posted

You could also make it into a toolbar button if you will need to use it over and over...

Posted

can you do it as lisp routine? if so, would you please show me how to. thanks.

Posted

PSLTSCALE affects the entire drawing, not individual layouts... or am I wrong?

Posted
PSLTSCALE affects the entire drawing, not individual layouts... or am I wrong?

Wrong... new layouts will assume the current value of Psltscale, but to change the Psltscale of existing layouts, you need to it individually.

 

Try this, it works for me, notice it also changes the Ltscale and Msltscale; you can remove those lines if you so choose.

;sets msltscale, ltscale & psltscale=1 for all layouts

(defun c:layoutltscale ( / lay ct)
(setq ct (getvar "ctab"))
(setvar "ltscale" 1)    
(setvar "msltscale" 1)
(foreach lay (layoutlist)(command "_layout" "_Set" lay "_mspace" "psltscale" 1))
(setvar "ctab" ct)
);defun

Posted

Ok, I'm too slow...

 

lpseifert- I like that you included LTSCALE and MSLTSCALE in yours :)

Posted
Wrong... new layouts will assume the current value of Psltscale, but to change the Psltscale of existing layouts, you need to it individually.
Thank you for the clarification, I was unaware of this.

 

Always went by the ACAD help: "Saved in: Drawing"

Posted

I wrote it when Msltscale became available to correct indiscretions by some people at work; they would keep mucking with the ltscale and psltscale because they wanted to see the linetypes in model tab.

Posted
I wrote it when Msltscale became available to correct indiscretions by some people at work; they would keep mucking with the ltscale and psltscale because they wanted to see the linetypes in model tab.

 

Yep - I remember one really confusing day when I first figured that out. I think it was REMARK that helped me :)

Posted

i had an issue with this in older files, i just wrote a reactor that when i switched into paperspace, it would set the psltscale to 1.

 

i'll post it when i get home.

Posted

here you go. whenever you switch to a layout, it sets the psltscale to 1

 

(defun ChangedLayout (reactor layout / )
 (if (/= (nth 0 layout) "Model")
   (setvar "psltscale" 1)
 );if
);defun
 
(if
 (not *LayoutLTS*)
  (setq *LayoutLTS*
   (VLR-Miscellaneous-Reactor nil '((:VLR-layoutSwitched . ChangedLayout)))
  );setq
);if

Posted
i had an issue with this in older files, i just wrote a reactor that when i switched into paperspace, it would set the psltscale to 1.

 

i'll post it when i get home.

 

Ok, I'm interested - as a complete LISP newbie, exactly what is a reator and how do you use them?

 

Sorry if I'm hijacking the thread :)

 

Thanks

Posted
I wrote it when Msltscale became available to correct indiscretions by some people at work; they would keep mucking with the ltscale and psltscale because they wanted to see the linetypes in model tab.

 

Boy do i know that feeling, i open a drawing and take on look and want to scream, mind if i use that lisp of yours?

 

Ok, I'm interested - as a complete LISP newbie, exactly what is a reator and how do you use them?

 

Sorry if I'm hijacking the thread :)

 

Thanks

 

From AutoCAD help:

 

 

vlr-lisp-reactor

 

 

 

Constructs an editor reactor object that notifies of a LISP event

(vlr-lisp-reactor data callbacks)

Arguments

data Any AutoLISP data to be associated with the reactor object; otherwise nil if no data.

 

callbacks A list of pairs of the following form:

(event-name . callback_function)

where event-name is one of the symbols listed in the “Lisp reactor events” table below, and callback_function is a symbol representing a function to be called when the event fires. Each callback function accepts two arguments:

reactor_object The VLR object that called the callback function.

list A list of extra data elements associated with the particular event. The contents of this list for particular events are shown in the table Lisp reactor callback data” table.

 

Return Values

The reactor_object argument.

Lisp reactor events

Event name

Description

:vlr-lispWillStart

An AutoLISP expression is to be evaluated.

:vlr-lispEnded

Evaluation of an AutoLISP expression has been completed.

:vlr-lispCancelled

Evaluation of an AutoLISP expression has been canceled.

 

Lisp reactor callback data

Name

List length

Parameters

:vlr-lispEnded

:vlr-lispCancelled

0

 

:vlr-lispWillStart

1

A string containing the first line of the AutoLISP expression to evaluate.

Posted

go for it man :)

i had to write that thing, i was tired of the boss looking at an older planset i was revising, and the first thing he would say would be "what's going on with all the lines, i thought some were supposed to be dashed?"

everytime, it was just a matter of fixing the psltscale. i never seem to have the problem on new projects i start from scratch, it's just the older ones.

 

Boy do i know that feeling, i open a drawing and take on look and want to scream, mind if i use that lisp of yours?

 

 

 

From AutoCAD help:

 

 

vlr-lisp-reactor

 

 

 

Constructs an editor reactor object that notifies of a LISP event

(vlr-lisp-reactor data callbacks)

Arguments

data Any AutoLISP data to be associated with the reactor object; otherwise nil if no data.

 

callbacks A list of pairs of the following form:

(event-name . callback_function)

where event-name is one of the symbols listed in the “Lisp reactor events” table below, and callback_function is a symbol representing a function to be called when the event fires. Each callback function accepts two arguments:

reactor_object The VLR object that called the callback function.

list A list of extra data elements associated with the particular event. The contents of this list for particular events are shown in the table Lisp reactor callback data” table.

 

Return Values

The reactor_object argument.

Lisp reactor events

Event name

Description

:vlr-lispWillStart

An AutoLISP expression is to be evaluated.

:vlr-lispEnded

Evaluation of an AutoLISP expression has been completed.

:vlr-lispCancelled

Evaluation of an AutoLISP expression has been canceled.

 

Lisp reactor callback data

Name

List length

Parameters

:vlr-lispEnded

:vlr-lispCancelled

0

 

:vlr-lispWillStart

1

A string containing the first line of the AutoLISP expression to evaluate.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...