Copy part of drawing placed in PS viewport from one drawing to other drawing

Copy part of drawing placed in PS viewport from one drawing to other drawing

Anonymous
Not applicable
533 Views
5 Replies
Message 1 of 6

Copy part of drawing placed in PS viewport from one drawing to other drawing

Anonymous
Not applicable

I often need to copy part of drawing placed in PS viewport from one drawing to other drawings

I did it manually by following steps:

  1. First of all in a source drawing from PS I draw outline for viewport, I want to copy to other drawings
  2. UCS – World and From MS I do “copy with base point” 0,0,0
  3. In target drawing I change UCS to World too and do “Paste with original coordinates”
  4. In a source drawing in PS I copy to clipboard viewport..
  5. In target drawing I go to PS and paste saved viewport when I already have in MS necessary part of drawing.My question is: How can I automate this “short” algorithm via lisp 

Any help will be appreciated

 

0 Likes
534 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Here is old code to wblock to a file and another command to insert.
(defun C:WBB (/ NN SS)
(setq NN (strcat "C:/Temp/" (getvar "LOGINNAME")))
(princ (strcat "\nSelect Entities to Write to file [" NN "]."))
(setq SS (ssget))
(if SS
(progn
(if (findfile (strcat NN ".DWG"))
(command "_WBLOCK" NN "Y" "" "0,0,0" SS "")
(command "_WBLOCK" NN "" "0,0,0" SS "")
)
(if (= (getvar "CMDDIA") 0) (command "N"))
(command "_U")
)
)
(princ)
)
(defun C:INI (/ NN)
(setq NN (strcat "C:/Temp/" (getvar "LOGINNAME")))
(if (findfile (strcat NN ".DWG"))
(command "_INSERT" (strcat "*" NN) "0,0,0" 1 0)
(princ (strcat "\nError - user drawing [" NN "] NOT Found."))
)
(princ)
)
0 Likes
Message 3 of 6

Anonymous
Not applicable

probably I don't undestand somefing, but it not so clear for me how to use this awesome programm in order to copy viewport to other drawing..

0 Likes
Message 4 of 6

Anonymous
Not applicable
load the 2 programs in autocad
in 1st drawing, type WBB, select objects
in 2nd drawing, type INN to insert object
0 Likes
Message 5 of 6

Anonymous
Not applicable

how can I select the viewport in PS and part of drawing within viewport  in MS in one step? Is it possible?

0 Likes
Message 6 of 6

Anonymous
Not applicable

I did some unsuccessful changes in program of MP (http://www.theswamp.org/index.php?action=profile;u=160) in function c:CB  in order to make a selection set from PS and during selection to activate floating MS viewport to continue to make a selection set but program don’t  want to make me happy:) Please check the code and tell me that's wrong...

 

0 Likes