add point, block, or circle to circle

add point, block, or circle to circle

Anonymous
Not applicable
2,084 Views
9 Replies
Message 1 of 10

add point, block, or circle to circle

Anonymous
Not applicable
Pipes with cables are considered occupied. Occupied pipes are represented as a circle with a smaller, shaded circle at the center. I'd prefer to select a groups of occupied pipes to indicate because there are many. What is the best way? V/r
0 Likes
Accepted solutions (1)
2,085 Views
9 Replies
Replies (9)
Message 2 of 10

ВeekeeCZ
Consultant
Consultant

Hi, best would be if you could post some samples.

 

But you want select

just circles of occupied pipes

or circles of occupied pipes AND its shaded circle.

 

Shaded circle is just smaller in the center, or smaller by specific factor.

0 Likes
Message 3 of 10

Anonymous
Not applicable
I need to select and change empty pipes to show as occupied pipes. The
selected empty pipse should change to show the shaded circle. The
shaded circle is about 1/4 the diameter of the pipe.

Perhaps the solution could be as simple as insert block at center.
That's what I'm manually doing now. V/r
0 Likes
Message 4 of 10

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
I need to select and change empty pipes to show as occupied pipes. The selected empty pipse should change to show the shaded circle. The shaded circle is about 1/4 the diameter of the pipe.

Perhaps the solution could be as simple as insert block at center.
,,,.

A routine could certainly be made that would ask you to select Circles, and would put such a Block in the center of each one for you.  Presumably the scale factor of the Block be related to the radius of each Circle -- if the un-scaled Block is one drawing unit in radius, it would be easy to use a quarter of the Circle's radius as Insert scale factors, or if it were a quarter of a unit, the Circle's radius directly.  Does that sound like what you want?

Kent Cooper, AIA
0 Likes
Message 5 of 10

ВeekeeCZ
Consultant
Consultant

So try this... if you want to some more automation, need to see a sample dwg.

 

(defun C:BlkInCicle ( / ss n)
  (if (and (princ "\nNeed circles,")
	   (setq ss (ssget '((0 . "CIRCLE")))))
    (repeat (setq n (sslength ss))
      (command "_.-INSERT"
	       "NameOfYourOccupiedBlock" 
	       "_R" 0
	       "_Scale" (* 0.25 (cdr (assoc 40 (entget (ssname ss (setq n (1- n))))))) ; assumes that R of Circle inside of the block is 1.
	       "_none" (cdr (assoc 10 (entget (ssname ss n)))))))
  (princ)
)
0 Likes
Message 6 of 10

Anonymous
Not applicable
Almost. Can you have it insert the block without scaling? The block I use is already the correct size so rescaling it makes too small. V/r
0 Likes
Message 7 of 10

ВeekeeCZ
Consultant
Consultant
Accepted solution

Sure...

 

(defun C:BlkInCicle ( / ss n)
  (if (and (princ "\nNeed circles,")
	   (setq ss (ssget '((0 . "CIRCLE")))))
    (repeat (setq n (sslength ss))
      (command "_.-INSERT"
	       "NameOfYourOccupiedBlock"
	       "_R" 0
	       "_Scale" 1
	       "_none" (cdr (assoc 10 (entget (ssname ss (setq n (1- n)))))))))
  (princ)
)
0 Likes
Message 8 of 10

Kent1Cooper
Consultant
Consultant

... or, since scale factors of 1 and rotation of 0 are always the defaults in a command-line Insert command, you don't need to call for those explicitly:
....

(command "_.-INSERT"
  "NameOfYourOccupiedBlock"

  "_none" (cdr (assoc 10 (entget (ssname ss (setq n (1- n))))))))

  "" "" "" ; default scales/rotation

)

Kent Cooper, AIA
0 Likes
Message 9 of 10

Anonymous
Not applicable
Thanks for weighing in guys. These are good study codes to learn.
0 Likes
Message 10 of 10

ВeekeeCZ
Consultant
Consultant

@Kent1Cooper wrote:

... or, since scale factors of 1 and rotation of 0 are always the defaults in a command-line Insert command, you don't need to call for those explicitly:
....

(command "_.-INSERT"
  "NameOfYourOccupiedBlock"

  "_none" (cdr (assoc 10 (entget (ssname ss (setq n (1- n))))))))

  "" "" "" ; default scales/rotation

)


Thanks Kent for suggestion. In my opinion it has pros and cons .... The series of "" "" "" could be quite unclear... but mostly scale is quite tricky, it can be "" "" or just "" for uniform scale... So... yes, I agree, presetting of rotate could be omitted.

0 Likes