Need lisp

Need lisp

jowie6XC4P
Contributor Contributor
528 Views
8 Replies
Message 1 of 9

Need lisp

jowie6XC4P
Contributor
Contributor

Good day, heres the situation...

I have a drawing in which the limits is set to 0,0 420,297 equivalent to scale 1 of A3 size

now if want to rescale it into 2, limits shoud be changed 0,0 840,594

 

is there any lisp that youll only need to input the scale factor and changed the limits accordingly depending on the scale given

 

 

 

0 Likes
Accepted solutions (2)
529 Views
8 Replies
Replies (8)
Message 2 of 9

cadffm
Consultant
Consultant

Hi,

 

why are you using limiten feature 🤔

and why are you need lispcode for this change 🤔

 

For users who can not use lisp or don't need lisp, you can do it by a simple menu macro

'_.LIMMAX;$M=$(*,2,$(index,0,$(getvar,LIMMAX))),$M=$(*,2,$(index,1,$(getvar,LIMMAX)));_.REGEN

Sebastian

0 Likes
Message 3 of 9

jowie6XC4P
Contributor
Contributor

is this macro for scale 2? what iwant is it will prompt what scale to be used and it will multiply to 420,297

0 Likes
Message 4 of 9

cadffm
Consultant
Consultant

 

 

 

 

 

 

 

 

 

 


@jowie6XC4P  schrieb:

is this macro for scale 2? Yes

 

what iwant is it will prompt what scale to be used

Okay

 

and it will multiply to 420,297

multiply to 420,297 or multiplay to the current limmax?


Sample for limmin=0,0 limmax=420,297*user defined multiplier

 

^C^C^C_.USERI1;\_.LIMMIN;0,0;_.LIMMAX;$M=$(*,$(getvar,USERI1),420),$M=$(*,$(getvar,USERI1),297);_.REGEN

 

( still like to know why you are using limiten and don't like to offer a lisp solution 😉 )

 

 

 

Sebastian

Message 5 of 9

jowie6XC4P
Contributor
Contributor

macro or lisp, whatever as long as it has same function 😁

 

by the way can you tweak it a bit so it will accept a decimal figure?

0 Likes
Message 6 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

@jowie6XC4P wrote:

....

is there any lisp that youll only need to input the scale factor and changed the limits accordingly depending on the scale given


In simplest terms, if I understand correctly what you're trying to do:

(defun C:LA3 (/ sc); = Limits for A3 sheet size
  (setq sc (getreal "\nScale {1 in}: "))
  (setvar 'limmin '(0 0))
  (setvar 'limmax (mapcar '* '(420 297) (list sc sc)))
)

 

Kent Cooper, AIA
Message 7 of 9

cadffm
Consultant
Consultant
Accepted solution

Just to have answered this requirement as well:


@jowie6XC4P  schrieb:

so it will accept a decimal figure?


USERI1 is for Integer, as you can read in your help [F1]

For Reals you can use USERR1 instead USERI1 - [F1]

 

 

 
 

 

 

Sebastian

0 Likes
Message 8 of 9

jowie6XC4P
Contributor
Contributor

big thanks for all the help

0 Likes
Message 9 of 9

Sea-Haven
Mentor
Mentor

We have used a A1 title block for years, it is set up in a layout and has been drawn 1=1 ie 841x594, so if plotted at 1=1 gives a A1 sheet, but we want A3, dont change the title block just change the output plot scale 1=2 you then get A3. What can be more simple and thats why layouts were invented.

 

SeaHaven_0-1675987266639.png

 

0 Likes