Author Topic: Copy block from xref  (Read 8715 times)

0 Members and 1 Guest are viewing this topic.

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Copy block from xref
« Reply #15 on: December 14, 2015, 05:26:46 AM »
I thought about endless loop, but it can be a real problem when you have "heavy" drawing, because edit in place in this case become too slowly..
Is it possible to make selection set during the one session of refedit function?

After each loop user chooses which reference from which reference parent he/she wants to copy... If drawing is heavy, it'll be also slow to use single mode... With while loop, user is in situation to avoid repetition of issuing command through command line interface and this makes some improvement in working and with larger drawings... I am afraid that selecting blocks while in refedit mode user may choose inappropriate nesting level for his/her copying attempt, so I would avoid this road by my opinion...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Copy block from xref
« Reply #16 on: December 14, 2015, 06:17:06 AM »
danglar, for completeness of this topic, consider this lisp routine - it does what you asked, but it's called different "nlevelcopy"... It refers to all entities (inserts+normal) on picked particular level of nesting...

Code - Auto/Visual Lisp: [Select]
  1. (defun c:nlevelcopy ( / ns l p ss el )
  2.   (while (setq ns (nentsel "\nPick nested level to copy from parent reference"))
  3.     (setq l (last ns))
  4.     (setq p (cadr ns))
  5.     (command "_.-REFEDIT" "_non" p)
  6.     (repeat (- (length l) 2)
  7.       (command "_N")
  8.     )
  9.     (command "_O" "_A" "_Y")
  10.     (setq el (entlast))
  11.     (setq ss (ssget "_:L"))
  12.     (command "_.COPY" ss "")
  13.     (while (< 0 (getvar 'cmdactive))
  14.       (command "\\")
  15.     )
  16.     (setq ss (ssadd))
  17.     (while (setq el (entnext el))
  18.       (ssadd el ss)
  19.     )
  20.     (command "_.REFSET" "_R" ss "")
  21.     (command "_.REFCLOSE" "_D")
  22.   )
  23.   (princ)
  24. )
  25.  

HTH, M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

danglar

  • Newt
  • Posts: 161
  • Read My Li(s)(p)
Re: Copy block from xref
« Reply #17 on: December 14, 2015, 06:21:12 AM »
I checked, what you say about refedit  "single mode" in a large drawings and my conclusion -  unfortunaly you are right.
Unfortunaly ,  because  this is not a solution for my problem (I mean large drawings..)
In other hand, endless loop can help me partially if I will use Ncopy function instead of refedit function..
Is it possible to involve NCOPY function in your program?

danglar

  • Newt
  • Posts: 161
  • Read My Li(s)(p)
Re: Copy block from xref
« Reply #18 on: December 14, 2015, 06:32:56 AM »
The last one is exactly what I need!
Thank you ribarm.

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Copy block from xref
« Reply #19 on: December 14, 2015, 06:36:12 AM »
The last one is exactly what I need!
Thank you ribarm.

Thank you too...
M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Copy block from xref
« Reply #20 on: December 15, 2015, 01:10:05 PM »
I know a solution has already been found, but the code posted here
http://www.theswamp.org/index.php?topic=24251.msg293025#msg293025
will allow the user to select the item to be copied into the current drawing.  It will allow the user to select the depth at which an item will be copied.

It will also allow you to select a whole layer to be copied in the current drawing (another command that is listed in the second post).
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

danglar

  • Newt
  • Posts: 161
  • Read My Li(s)(p)
Re: Copy block from xref
« Reply #21 on: December 16, 2015, 01:42:46 AM »
Thank you  T.Willey for your program.
It works good even very good, but when you copy items to current drawing you have a problem to move it to another place..
Is it possible to involve a "move" command to selection set of items "transferred" to current drawing from nested one, like in a one of previous posts?


Code - Auto/Visual Lisp: [Select]
  1. (command "_.move" p "" pause)  ; HIGHLIGHT IT AND BEGIN A MOVE ACTION
  2.  
« Last Edit: December 16, 2015, 01:47:19 AM by danglar »

lamarn

  • Swamp Rat
  • Posts: 636
Re: Copy block from xref
« Reply #22 on: December 18, 2015, 05:40:29 PM »
Because i liked this little tweat so much.
I made a video to get the picture and share it with others.
If you like the dynamic xyz nr. Block used, you could write me a call
Hans

http://youtu.be/2Tga0J2tWeE
Design is something you should do with both hands. My 2d hand , my 3d hand ..