Jump to content

Plot named views


migs

Recommended Posts

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 by migs
Link to comment
Share on other sites

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 by pBe
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

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"

Link to comment
Share on other sites

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 :oops:

 

just running through some checks on it but so far it seems to be exactly what im looking for!

 

cheers pBe

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