Jump to content

script to plot all (named)views


Recommended Posts

Pmxcad can you post your script as code please keeps trying to run it rather than open to look.

 

Anyway I am sure this question has been asked before, if you search for the auto plot lisp examples I know I posted to do layouts, but the only change to the code would be to retrieve the views table info instead of layouts and step through them.

 

Try this

(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for lay (vla-get-Views doc)
(setq plotabs (cons (vla-get-name lay) plotabs))
)

Edited by BIGAL
Link to comment
Share on other sites

(foreach lay (layoutlist) (setvar "CTAB" lay) (command "PSPACE" "ZOOM" "E" "_PLOT" "Y" "" "DWG TO PDF" A3"" "M" "LANDSCAPE" "N" "E" "FIT" "" "Y" "Grayscale" "Y" "N" "N" "N" "" "N" "Y" ))

Link to comment
Share on other sites

Take your code and for views as per above example but replace the "E extents" with a "V" and the lisp variable to follow for the view name just do manually to get correct Y N etc

 

Enter plot area [Display/Extents/Limits/View/Window] : V

Link to comment
Share on other sites

No sorry Bigal. This is not wat i like to have. I like to have a script look like the script in my post, but for the use of all the (named)views in a drawing. The script i use for plotting all the layouts, makes a sort of list from all the layouts.

Iàm not into lisp and so i don`t know how to do rebuild it for the use for all the named views in a drawing, model or paperspace.

I do know how to plot the views with the help of a script and give in the name of a named-view. But i`ve got a lot of drawings with named-views and they don`t have the same names.

 

Thanks,

PmxCAD

Link to comment
Share on other sites

This is lisp not script it just needs a tweak to do what you want, wheres the code for (layoutlist)

 

(foreach lay (layoutlist) (setvar "CTAB" lay) (command "PSPACE" "ZOOM" "E" "_PLOT" "Y" "" "DWG TO PDF" A3"" "M" "LANDSCAPE" "N" "E" "FIT" "" "Y" "Grayscale" "Y" "N" "N" "N" "" "N" "Y" ))

Link to comment
Share on other sites

I thought it has the SCR extention so is a script. I think i was wrong. I'am only looking for a script or lisp to plot al the named views in a drawing, both model or layout.

Link to comment
Share on other sites

Scripts can run lisps rename it to plotviews.lsp then use (load "plotviews") there is no extra script code in this posted example.

 

Again post (layoutlist) so we can help it may be autoloaded.

Link to comment
Share on other sites

Ok understand by putting (layoutlist) you were implying this is a lisp Function rather than a list of view names, give this a try not tested, copy and paste to notepad save as plotviews.lsp then appload it.

 

vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for lay (vla-get-Views doc)
(setq plotabs (cons (vla-get-name lay) plotabs))
)
(foreach lay plotab(setvar "CTAB" lay) (command "PSPACE" "ZOOM" "E" "_PLOT" "Y" "" "DWG TO PDF" A3"" "M" "LANDSCAPE" "N" "V" "FIT" "" "Y" "Grayscale" "Y" "N" "N" "N" "" "N" "Y" ))(princ)

Link to comment
Share on other sites

Said it was not tested good time to learn lisp extra right paren means its missing a ( or ) also change plotabs to plotab have a lok at the first line my typo

Link to comment
Share on other sites

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...