Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Member
jonathan.talisman
Posts: 4
Registered: ‎02-22-2012
Message 1 of 3 (221 Views)

Getting to many viewports -- Iterating through viewPorts on a specific layout .

221 Views, 2 Replies
02-22-2012 06:09 AM

I am writing some AutoLisp routines and I am doing the following :

; the layout parameter is a vla-object of type of a layout

 

(defun-q get-ViewPorts (Layout / LayoutBlock ViewPorts)
(setq LayoutBlock (vla-get-Block layout))
(vlax-for i LayoutBlock
(if (= "AcDbViewport" (vla-get-objectName i ))
(setq viewPorts (cons i viewPorts))
)
)
viewPorts
)

 

The problem is that I am getting one viewport  too many - if there are no viewports I get one , if there is one I get two etc.... I am guessing the layout itself or any current view is some sort of a AcDbViewPort ~ how do I 'filter ' it out .

 

Thanks , Jonathan

Mentor
jtbworld
Posts: 181
Registered: ‎08-03-2007
Message 2 of 3 (215 Views)

Re: Getting to many viewports -- Iterating through viewPorts on a specific layou

02-22-2012 06:49 AM in reply to: jonathan.talisman

The paper space has a viewport itself so if you want the number of viewports subtract the total with one.

The first viewport in each layout is the layout itself.

Jimmy Bergmark
JTB World - Software development and consulting
Specialities: AutoCAD, AutoCAD Architecture and Revit
http://www.jtbworld.com

JTB FlexReport - network license reports
http://www.jtbworld.com/jtbflexreport/index.htm
Member
jonathan.talisman
Posts: 4
Registered: ‎02-22-2012
Message 3 of 3 (209 Views)

Re: Getting to many viewports -- Iterating through viewPorts on a specific layou

02-22-2012 07:02 AM in reply to: jonathan.talisman
Great , thanks
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!