Lisp to Create multiple viewport

Lisp to Create multiple viewport

francine.zimmermannSRSWJ
Advocate Advocate
6,168 Views
44 Replies
Message 1 of 45

Lisp to Create multiple viewport

francine.zimmermannSRSWJ
Advocate
Advocate

I'm looking for a lisp to create multiple viewport.

I've found a lisp on the internet that almost meets my expectations, its name is NV.lsp. (see attached file)

I need 2 things, redo the same operation several times and insert the window not in the centre but in relation to a corner (for example the bottom left corner).

Does anyone know how to integrate this into this lisp?

Thank you very much in advance for the help

 

 

0 Likes
Accepted solutions (2)
6,169 Views
44 Replies
Replies (44)
Message 2 of 45

pendean
Community Legend
Community Legend

May I ask, why not just create a redefined layout(s) with those viewports locations and scales in a template file(s) then just import them when needed?

0 Likes
Message 3 of 45

francine.zimmermannSRSWJ
Advocate
Advocate

In the model space I have a section over 10m long with lots of details.

When I prepare the multiple viewports it's more visible in the model space.

0 Likes
Message 4 of 45

paullimapa
Mentor
Mentor
Accepted solution

Attached is updated code with the following modifications:

1. Vport layout placement is at lower left corner
2. Default setting to switch back to Model vs staying in Layout
3. NV loops until Esc or Enter during first point of view selection
Give this a try and let me know if that works for you.

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 5 of 45

francine.zimmermannSRSWJ
Advocate
Advocate

Thank you very much, I'm going to show it to my colleagues to see if it's what they'd like.
Maybe I'll come back with a small request, but for me it's what I was looking for.

0 Likes
Message 6 of 45

paullimapa
Mentor
Mentor

Glad this worked for you…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 7 of 45

Sea-Haven
Mentor
Mentor

This walks along a P/Line following it and making rectangs that match your title block at scale. Second step is make layouts. 2nd version is just copy rectangs, you can rotate and move before making layouts.

SeaHaven_0-1713918205253.png

Happy to discuss.

 

 

0 Likes
Message 8 of 45

francine.zimmermannSRSWJ
Advocate
Advocate

Hi Paul,

I showed it to my colleagues and they asked me if it was possible to choose several windows view before inserting into the layout, (all choose window will have the same scale)

2.png

Is that possible?

0 Likes
Message 9 of 45

francine.zimmermannSRSWJ
Advocate
Advocate

Hello,

Is this also based on Lisp?

0 Likes
Message 10 of 45

paullimapa
Mentor
Mentor

I've renamed & created a new function called NVM.lsp that allows for multiple view selections.

Let me know if this works out for you.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 11 of 45

Sea-Haven
Mentor
Mentor

Yes my code is lisp, you want something like this when making say the 1st rectang. Then just copy and rotate to suit.

SeaHaven_0-1714104551794.png

 

0 Likes
Message 12 of 45

francine.zimmermannSRSWJ
Advocate
Advocate

Hello Paul,

Thank a lot for your help, my colleagues asked me one last thing:

Is it possible, once I've chosen a set of views, to insert them in the same chosen layout ?

4.png

For exemple rectangle 1, 2 and 3, insert in Layout 1.

If I want to change layout I have to redo the command 

0 Likes
Message 13 of 45

paullimapa
Mentor
Mentor
Accepted solution

Sure, I've modified the NVM.lsp code to do just that.

I also added an option to bring up a VPort Scale list in a dialog box to select from.

Let me know how that works out for you!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 14 of 45

francine.zimmermannSRSWJ
Advocate
Advocate
Hello Paul,
This is exactly what we were looking for, thank you very much for your help, have a good weekend!
0 Likes
Message 15 of 45

paullimapa
Mentor
Mentor

glad to have helped & you have a great weekend too...cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 16 of 45

allanthebruce
Advocate
Advocate

Hi There, 

Hope you can help, Im getting this error??

 

Select first point of view or Enter to Exit:
Select second point of view:
1 View Selected...
Select first point of view or Enter to Exit:
1 Views Selected...Regenerating layout.
Command:
Select Point for 1 of 1 Viewports: Error: divide by zeroRegenerating model.
Command:
Hope you can help and appreciate it.

Thanks

Allan

0 Likes
Message 17 of 45

allanthebruce
Advocate
Advocate

Hope you can help,

Could this be modified to select a block with attribute number (rectangle of viewport size-and attribute sheet number) , then with a xy insertionfor viewpost size bottom left 0,0 user can modify, then it creates viewport,  names it the attribute sheet number? Just 1 attribute viewport per sheet.

I Can send a sample out of outcome?

Thanks

Allan

 

0 Likes
Message 18 of 45

paullimapa
Mentor
Mentor

So the attribute contains the name of the layout the vport should go onto?  What happens when such a layout does not exists?
Attach a dwg with the Block and attribute so I can take a look. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 19 of 45

allanthebruce
Advocate
Advocate

Thanks for getting back to me.

This attached is the viewport with the attribute name, note its insertion point also. If I had multiple say 5 it could either add or create and name the viewport. I do have a titleblock also so maybe it just adds the viewport.

Hope that makes sense.

Thankyou kindly

Allan

0 Likes
Message 20 of 45

paullimapa
Mentor
Mentor

I see that this is the name of the block and there's only one attribute:

paullimapa_0-1718250837727.png

More questions:

1. Will the block being selected always be named as A1_horizontal and the Attribute Tag name is MAPSHTNUM

2. In this case the Attribute value is "01" and that means it'll go onto layout named "1"?

3. As I asked earlier, let's say the Attribute value is "02" but there's no layout named "2", should a new empty layout be created and be given name of "2"?

4. Like with previous NVM.lsp should a request be made for the user to select location on the matching layout to place the Vport?

5. Like with previous NVM.lsp should a request for the Vport scale be only prompted for once to apply to all Blocks selected or have the Vport scale prompt window appear before adding each Vport onto the corresponding layout?

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes