Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating a viewport using LISP

12 REPLIES 12
Reply
Message 1 of 13
Anonymous
2829 Views, 12 Replies

Creating a viewport using LISP

I have a series of drawings that are currently in modelspace. What I have to do is

1) Insert a new border in paperspace

2) create a viewport and place the view in modelspace into it.

 

I am trying to use the command -vports but get an SPPROCESSQUEUE error wghen I use lists such as this:

(command -vports (list 0.625 23.59375) "" (list 35.4375 2.625) "")

 

Any ideas on how I should be working this?

 

Thanks

John

12 REPLIES 12
Message 2 of 13
_Tharwat
in reply to: Anonymous

I guess this would take care of everything .

 

   (command "_.-layout" "_New" "")

 

Regards.

 

Tharwat

Message 3 of 13
hgasty1001
in reply to: Anonymous

(setq p1 (getpoint "\Fisrst Point: "))

(setq p2 (getpoint "\Second Point: "))

(command "mview" p1 p2)

Message 4 of 13
_Tharwat
in reply to: hgasty1001

gasty.

 

It is better to be the getpoint getcorner things like this .

 

(setq p1 (getpoint "\n Specify first point :"))
(setq p2 (getcorner p1 "\n Specify second point :"))

 

Regards,

 

Tharwat

Message 5 of 13
Anonymous
in reply to: _Tharwat

The points are always the same, and when I say "a series of drawings", I mean ~2000 of them.

 

I will try

(setq p1 (getpoint (list 0.625 23.59375)))

(setq p2 (getcorner (list 35.4375 2.625)))

Message 6 of 13
Kent1Cooper
in reply to: Anonymous


@Anonymous wrote:

The points are always the same, and when I say "a series of drawings", I mean ~2000 of them.

 

I will try

(setq p1 (getpoint (list 0.625 23.59375)))

(setq p2 (getcorner (list 35.4375 2.625)))


In that case, don't use the (get...) functions, which require user input [that's what the "get" part is about].  Just set the points:

 

(setq p1 '(0.625 23.59375 0))

(setq p2 '(35.4375 2.625 0))

 

or, if you're going to use them only once, and if gasty1001's Mview approach works, forget the variables and use the points directly inside that command:

 

(command "mview" '(0.625 23.59375 0) '(35.4375 2.625 0))

Kent Cooper, AIA
Message 7 of 13
Shneuph
in reply to: Kent1Cooper

If you're "inserting" the border why can't you have the viewport insert along with the border?

 

You can save a drawing named "LayoutTemplate.dwg" with the layout named "NewLayout" already setup (including the viewport)

 

Then in your ~2000 dwgs do something like:

 

(setvar "filedia" 0)
(Command "Layout" "t" "[path\\LayoutTemplate.dwg]" "NewLayout")

(setvar "filedia" 1)

 

This may work?

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 8 of 13
Anonymous
in reply to: Shneuph

Sorry for the delay in response, we went another route and are not using vports at all.

Message 9 of 13
Anonymous
in reply to: Anonymous

Do you mind sharing what other option you used?

Message 10 of 13
CodeDing
in reply to: Anonymous

@Anonymous ,

 

The most likely option, in this case, is that the -PLOT command was used in each drawing. I have hyperlinked it if you might be interested in researching it further.

 

Best,

~DD

~DD
Senior CAD Tech & AI Specialist
Need AutoLisp help? Try my custom GPT 'AutoLISP Ace':
https://chat.openai.com/g/g-Zt0xFNpOH-autolisp-ace
Message 11 of 13
maratovich
in reply to: Anonymous

1. To print from a Model, it is not necessary to create layouts. You can print automatically.
2. To create layouts, try this:
AutoViewport

3. Attach an example of your file so that we can help you.

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
Message 12 of 13
Anonymous
in reply to: CodeDing

Thanks DD!

Message 13 of 13
Anonymous
in reply to: maratovich

Thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost