migs Posted April 11, 2012 Share Posted April 11, 2012 (edited) Hi all Looking for some quick help, I am trying to plot all named views in Model Space via Lisp but im running into a few problems at the moment the number of views in each drawing varies, i can get the lisp to view each individual view on screen but when printing it only prints the first view multiple times i.e 8 views total, onscreen it goes to each of the 8 individual views but prints 8 copies of the first view any ideas? (defun c:testplot (/ view) (while (setq view (tblnext "view" (null view))) (command "_.-view" "_restore" (cdr (assoc 2 view))) (command "_.plot" "y" "" "" "A3" "" "" "" "view" "" "" "" "" "standard.ctb" "" "" "" "y" "") ) ;_ while (princ) ) ;_ defun Edited April 11, 2012 by migs Quote Link to comment Share on other sites More sharing options...
pBe Posted April 11, 2012 Share Posted April 11, 2012 (edited) Instead of "_.view "_restore" Enter drawing orientation [Portrait/Landscape] <Landscape>: L Plot upside down? [Yes/No] <No>: N Enter plot area [Display/Extents/Limits/View/Window] <Window>: [color=blue][b]V[/b][/color] Enter view name <>: [b][color=blue][supply View Name Here][/color][/b] I just tried it.. it works here. (defun c:testplot (/ view) (while (setq view (tblnext "view" (null view))) [color=blue](command "_.plot" "Yes" "Model" "YourPrinter" "A3" "Inches" "Landscape" "No" "View" [b](cdr (assoc 2 view))[/b] "Fit" "Center" "Yes" "standard.ctb" "Yes" "Wireframe" "No" "No" "Yes") [/color] ) ;_ while (princ) ) Edited April 11, 2012 by pBe Quote Link to comment Share on other sites More sharing options...
migs Posted April 11, 2012 Author Share Posted April 11, 2012 pBe i guess my question is: is there a way to automatically add in the view names rather than specifying each one individually as like i said there could be 3 sheets or 50 sheets on the drawing thats why i was getting confused as i can get the screen to view each individual sheet automatically but it will only print the first sheet by the number of sheets it finds on screen Ive never had to deal with this before as id normally use the layout for each sheet however the company has setup the drawings in this way, hopefully i can convince them to change methods but for now im just trying to save some time Quote Link to comment Share on other sites More sharing options...
pBe Posted April 11, 2012 Share Posted April 11, 2012 pBei guess my question is: is there a way to automatically add in the view names rather than specifying each one individually as like i said there could be 3 sheets or 50 sheets on the drawing You will need to loop thru tblnext to make a list of "view", i not sure if theres any other way What you can do is compile the list then print, but that wouldnt be any better that printing while on the loop thats why i was getting confused as i can get the screen to view each individual sheet automatically but it will only print the first sheet by the number of sheets it finds on screen (command "_.plot" "y" "" "" "A3" "" "" "" "view" [color=blue]"" ;<--- first "view" name will remain as you are accepting the previous view name[/color] "" "" "" "standard.ctb" "" "" "" "y" "") ) ;_ that is why i suggest passing the view name after "View" Quote Link to comment Share on other sites More sharing options...
migs Posted April 11, 2012 Author Share Posted April 11, 2012 Instead of "_.view "_restore" Enter drawing orientation [Portrait/Landscape] <Landscape>: L Plot upside down? [Yes/No] <No>: N Enter plot area [Display/Extents/Limits/View/Window] <Window>: [color=blue][b]V[/b][/color] Enter view name <>: [b][color=blue][supply View Name Here][/color][/b] I just tried it.. it works here. (defun c:testplot (/ view) (while (setq view (tblnext "view" (null view))) [color=blue](command "_.plot" "Yes" "Model" "YourPrinter" "A3" "Inches" "Landscape" "No" "View" [b](cdr (assoc 2 view))[/b] "Fit" "Center" "Yes" "standard.ctb" "Yes" "Wireframe" "No" "No" "Yes") [/color] ) ;_ while (princ) ) Bingo! never even thought of adding in (cdr (assoc 2 view)) there just running through some checks on it but so far it seems to be exactly what im looking for! cheers pBe Quote Link to comment Share on other sites More sharing options...
pBe Posted April 11, 2012 Share Posted April 11, 2012 Good for you. Glad it helps. BTW: if you want to stick with the way you had it before, use "Display" instead of "view" Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 12, 2012 Share Posted April 12, 2012 Interesting how the same questions keep being asked http://www.cadtutor.net/forum/showthread.php?67793-script-to-plot-all-(named)views/page2&highlight=views Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.