About presspull

About presspull

saitoib
Advocate Advocate
511 Views
4 Replies
Message 1 of 5

About presspull

saitoib
Advocate
Advocate

Hi all.

command rectang 0,0 100,100

With the squares drawn, I get

In test1, I can successfully extrude it, but in test2, I get an error.
Why is this?
Please help me.

(defun c:test1 (/ th id vrs cent)
	(setq th 5)
	(setq id (car (entsel)))
	
	(setq vrs (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget id)))
	(setq cent (mapcar '/ (list (apply '+ (mapcar 'cadr vrs))
			(apply '+ (mapcar 'caddr vrs)))
			(list (length vrs) (length vrs))))
	(setq cent (list (car cent) (cadr cent) 0.0))

	(command "_.presspull" cent th "")
)

 

(defun c:test2
	( / th pt1 pt2 ss nn i id vrs cent)

	(setq th 5)
	(setq pt1 (getpoint "\nSelect area : "))
	(setq pt2 (getcorner pt1 "\nAnother corner :"))

	(setq ss (ssget "_C" pt1 pt2(list (cons 0 "LWPOLYLINE"))))
	(setq nn (sslength ss))
	
	(setq i 0)
	(while (< i nn)
		(setq id (ssname ss i))
		(setq vrs (vl-remove-if '(lambda (x) (/= (car x) 10)) (entget id)))
		(setq cent (mapcar '/ (list (apply '+ (mapcar 'cadr vrs))
				(apply '+ (mapcar 'caddr vrs)))
				(list (length vrs) (length vrs))))
		(setq cent (list (car cent) (cadr cent) 0.0))

		(command "_.presspull" cent th "")
		(setq i ( 1+ i))
	)
)
Saitoib
0 Likes
512 Views
4 Replies
Replies (4)
Message 2 of 5

hak_vz
Advisor
Advisor

@saitoib  Replace command PRESSPULL with command EXTRUDE. Create selection set of lwpolylines, and apply command with appropriate extrusion length. You don't  need to search for shape center point. Positive extrude length will create 3dsolid in direction of plane normal vector, and negative in opposite.

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 3 of 5

saitoib
Advocate
Advocate

 @hak_vz

In fact, I want to draw some separate shape inside the square and make this a hole.
This is not easy to do in AutoCAD's extrude, is it?
So I want to use presspull.

Thank you.

Saitoib
0 Likes
Message 4 of 5

saitoib
Advocate
Advocate

In the case of test2
"Click inside a surface, curve, or bounding area"
message appears.
Does this mean that it can't click inside the boundary correctly?

 

But if I insert 
(command "circle" cent 10)
I can draw a circle.

 

Why does ?

Saitoib
0 Likes
Message 5 of 5

saitoib
Advocate
Advocate

I finally understood the cause.

In the case of test1, the effect of entsel was still there, so I was able to select it.

 

When presspull is in the "Select object or bounding area" state, is it possible to select the object with the command?

 

On the other hand, the extrude command seems to be able to use entity names, so I guess I have to use exturde even if it requires more steps?

Saitoib
0 Likes