Jump to content

Recommended Posts

Posted (edited)

Hi everybody,

 

Anyone know how to save the view all defined view, and then plot as pdf. It is unable to save another view. How to make is work ?

 

Thanks !

 

 

(setq v 0)
(while 
(command "-view" "w" (strcat "view" (itoa v)))
(setq v (1+ v))
);while

Edited by SLW210
CODE tags not HTML tags!!!!!
Posted

There are two issues in your code excerpt:

  1. the syntax of VIEW command isn't respected; try to call -VIEW on prompter and see that you are missing the coordinates of the corners for desired view.
  2. the condition evaluated by WHILE function will always be True, so the code will run infinitely; you should limit somehow the number of iteration - according with what you intend to achieve.

Posted

Thank you MSasu ! If I want to use the while loop to get all the user selected view (the coordinates of the corners) and then save it unit user press "esc" or "ok" button. After that I can plot to pdf automatically. From above code, if I selected the first view it will exit the while loop. I think there is some wrong in my code. Is it possible to save all the views by "-view" command by lisp ?

 

 

 

 

There are two issues in your code excerpt:

  1. the syntax of VIEW command isn't respected; try to call -VIEW on prompter and see that you are missing the coordinates of the corners for desired view.
  2. the condition evaluated by WHILE function will always be True, so the code will run infinitely; you should limit somehow the number of iteration - according with what you intend to achieve.

Posted

The Window option of -VIEW command will save a new view in drawing as long you provide a name for it and a pair of points (the oposite corners of said view). How are defined those views you want to save?

Posted

Is it possible to prompt user select the view, then user select the oppsite corners. After that, it automatically provide the name until user press "esc" button.

 

Thank you ! MSasu.

 

 

The Window option of -VIEW command will save a new view in drawing as long you provide a name for it and a pair of points (the oposite corners of said view). How are defined those views you want to save?
Posted

I believe that this is what you were looking for:

(setq index  0
     answer "Yes")
(while (member answer '("Yes" nil))
(command "_.VIEW" "_W" (setq nameView (strcat "view" (itoa (setq index (1+ index)))))
         pause pause)
(initget "Yes No")
(setq answer (getkword (strcat "\nCreated view " nameView ". Do you want to add another one <Yes>/No): ")))
)

Posted

thank very much for your help !

 

 

 

I believe that this is what you were looking for:

(setq index  0
     answer "Yes")
(while (member answer '("Yes" nil))
(command "_.VIEW" "_W" (setq nameView (strcat "view" (itoa (setq index (1+ index)))))
         pause pause)
(initget "Yes No")
(setq answer (getkword (strcat "\nCreated view " nameView ". Do you want to add another one <Yes>/No): ")))
)

  • 2 weeks later...
Posted
I believe that this is what you were looking for:

(setq index  0
     answer "Yes")
(while (member answer '("Yes" nil))
(command "_.VIEW" "_W" (setq nameView (strcat "view" (itoa (setq index (1+ index)))))
         pause pause)
(initget "Yes No")
(setq answer (getkword (strcat "\nCreated view " nameView ". Do you want to add another one <Yes>/No): ")))
)

 

I want to try this MSasu.How can i load this please?

Posted

For a quick test just paste the above code to AutoCAD's command line.

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