• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

replace points with a block

  • Thread starter Thread starter Andrea Bertocco
  • Start date Start date
...remaining that the selected entities with ssget "x" or "_a" belong to the current layout.

@joseph
great info, thank you! :finger:
 
to andrea, which seems very interested in the topic, to supplement what has specified termin.., excuse, confutatis:

(ssget "_x") selects all the main objects of the database, even outside the screen, even places on deactivated and/or frozen floors.
However, there is an undocumented option of ssget:
(setq pts (ssget "_a))) that selects all the objects of the database (such as ssget "x"), except those located on frozen floors.

Hi.
I had some doubt about ssget behavior with the options "x" and "_a", without and with filters.
I have designed 10 circles on 3 layers (initially all on, then 1 frozen layer) in model space and 2 on paper space;
I created, on layer 0, 2 windows both in layout1 and in layout2;
in layout2 I then froze a layer for each window.
so I applied the 2 strands of code below both to model space and to paper space

without filters
(Sectq sel)
(setq i (sslength sel)

(Sectq sel)
(setq i (sslength sel)

space model
- all active layers
"x" option and "_a" option: number of objects selez. = 18 (10 in model space, 4 windows in paper space, 2 objects on layout1, 2 layouts (are they considered windows, then objects? )
- 1 layer freeze (with 3 objects):
option x: objects selez.= 18
option a: objects selez. =15 (maintain the 3 objects on the frozen layer)
----
Paper space:
- inside one of the windows: results are equal to the previous case
- on paper space and with frozen layers only locally: "x" and "_a": objects selez. =18; it deduces that the option

selez. with "_a" is influenced only by the global freezing (and not local in individual windows) of layers.

with filters
p.es (setq sel (ssget "x" (list '(0 . "circle")), the selection (n.ogg.=12), made in the model space (0 in paper space) includes all the circles, even those drawn on paper space.
----
different is the behavior of the selez command (opz. all)
from model space:
found(s) 18
8 were not in the current space.

from paper space
found(s) 18
13 were not in the current space
1 was a window in paper space (?? ? )
or (change layout)
found(s) 15
8 were not in the current space. What? ? )
and
adding a new layout, this is seen as an object, although no window has been drawn.
-----
commands that use object selection (e.g. copy, move, etc.) while selecting objects in both spaces (model and paper), however only affect objects in the current space.
 
hello to all you are very good and very useful.
Meanwhile thank you, for some time I've been using this lisp, I ask too much if it could be modified or integrated so that the self-inserting block goes to the layer to which the point is part.. ?
What do I need? Unfortunately I have no specific software ... in a few words what I have to do: I have the crucides(point) already inserted on the file.. at various coordinates x,y,z and are of various colors depending on the layer on which they are placed.., at the cross/point I should apply the value of the coord. z selecting the cloud of crucifixes. .
Can you do that? maybe insert a car block that updates depending on the characteristics of the point?


autocad in Italian

(defun c:rp()
(setq obj (car (entsel "\nsel select block: ")
(prompt "\n\nselect points")
(setq ss (ssget (cons 0 "point"))))
(setq inc 0)
(setq orgpnt (cdr))
(while (setq node (ssname ss inc))
(setq topnt (cdr (assoc '10)))
(command "_copy" obj " orgpnt topnt)
(setq inc (1+ inc))
)[/quote]
 
few modifications to the original rp.lsp, the selected block is inserted and not copied, before the insertion is set the plan relative to the point.
the block to acquire the properties of the plan must have the entities on plan 0.
I put in a "hundo mark" so if you want to go back you just need a "hundo back".
 

Attachments

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top