Copy block to multiple selection of objects

Copy block to multiple selection of objects

Anonymous
Not applicable
1,737 Views
6 Replies
Message 1 of 7

Copy block to multiple selection of objects

Anonymous
Not applicable

My procedure is this:
1. I extract a set of 3D points from the Photoscan software, which then have X, Y and Z coordinates;
2. amount of this dxf in Autocad;
3. I create a block (for example a circle with a cross) with a center in one of these points and then placed in space;
4. I attribute the position attribute to this block by selecting only the Z coordinate and assigning the label "QUOTA" to it;
5. manually copy this block on the model at each point (see step 1);
6. through Express Tools explode the attribute;
7. use the FLATTEN command to fade all points and attributes to zero.
8. at this point I have the set of points in 2D (all at altitude 0) with however indicated next to each of its previous altitude Z (altimetric);
My need is to have an automatic procedure that replaces and accelerates step 5 where instead I spend a lot of time copying the block on every point if these are obviously numerous.
In practice my idea is to have a command that allows me to copy the selected block (to which the position attribute is connected, for example) to a multiple selection of identical or similar objects, in my case all the objects in the drawing point or even better all the point objects that are on a specific layer.
Who can help me?

Thank's a lot.

Alexander

0 Likes
1,738 Views
6 Replies
Replies (6)
Message 2 of 7

Patchy
Mentor
Mentor

There are a few Autolisp placing a block at a node. That's what you need.

0 Likes
Message 3 of 7

Anonymous
Not applicable

Where I can find these Autolisp?

What is the procedure?

I don't know how write o program these type of Autolisp.

0 Likes
Message 4 of 7

Patchy
Mentor
Mentor

Download the .lsp and then in autocad you do a appload command, follow the instruction on this link.

https://autocadtips1.com/2012/03/27/autolisp-replace-selected-points-with-block/

 

0 Likes
Message 5 of 7

Anonymous
Not applicable

I tried the LISP and it works well.
Replaces the selected points with a block as desired.
The problem, however, is that if I in the block define an attribute (for example in my case the position Z) when the LISP performs the replacement I no longer see the label of the Z position that was defined in the attribute of the block.

This procedure replaces the point with a block.
Instead, I would like the block to be copied on all points.

0 Likes
Message 6 of 7

Patchy
Mentor
Mentor

Google for that type of routine, the one you used had instruction to it, there are many to do what you need.

Capture.JPG

0 Likes
Message 7 of 7

Anonymous
Not applicable

I find it ............

 

 

;;; Copy Object (block) on points
;;; Created by mdhutchinson
;;; Saved from: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-point-with-block-object/td-p...
;;; Slightly modified by Igal Averbuh 2017 (added option to select needful points)

 

(defun c:Rp()
(command "undo" "begin")
(princ "\nSelect Points: ")
(setq ss (ssget '((0 . "POINT"))))
;(setq ss (ssget "x" (list (cons 0 "point"))))
(setq inc 0)
(setq obj (car (entsel "\nSelect an Object to locate at each Selected point: ")))
(setq orgpnt (cdr (assoc '10 (entget obj))))
(while (setq node (ssname ss inc))
(setq topnt (cdr (assoc '10 (entget node))))
(command "_copy" obj "" orgpnt topnt)
(setq inc (1+ inc))
)
(princ "\nDone")
(command "undo" "end")
)
;(c:rp)

 

Thank you very much.

Best regards.

Alexander

0 Likes