Jump to content

Convert List Of Coordinates To Fence


Engineer_Yasser

Recommended Posts

I have a list of polyline vertex coordinates

 

((413540.0514,2885464.6320) (413537.4807,2885455.1222)  (413535.0813,2885449.2106))


I want to run this command transferring the list of vertex coordinates same as this example so the command accepts it as a fence


 

(vl-cmdf "_AeccDeleteSurfaceLine" "F" "413540.0514,2885464.6320" "413537.4807,2885455.1222" "413535.0813,2885449.2106" "" "" "")

 

Edited by SLW210
AddedCode Tags!!
Link to comment
Share on other sites

I do it this way

 

(setq MySet (ssget "_W" PLL PUR))	; to use Lower left and upper right coords

(setq MySet (ssget "_F" (list PLL PLR PUR PUL PLL))) 	; to use fence 

 

Link to comment
Share on other sites

12 minutes ago, kirby2 said:

I do it this way

 

(setq MySet (ssget "_W" PLL PUR))	; to use Lower left and upper right coords

(setq MySet (ssget "_F" (list PLL PLR PUR PUL PLL))) 	; to use fence 

 

 

I tried but "_AeccDeleteSurfaceLine" is different than SSGET , Thanks 

Link to comment
Share on other sites

1 hour ago, Engineer_Yasser said:

I tried but "_AeccDeleteSurfaceLine" is different than SSGET , Thanks 

Can't you plug the results of the SSGET into the command?

Perhaps like this? Sorry I don't have your vertical to test it.

setq MySet (ssget "_F" '((413540.0514,2885464.6320) (413537.4807,2885455.1222)  (413535.0813,2885449.2106))))

(vl-cmdf "_AeccDeleteSurfaceLine" Myset "" "" "")

 

Link to comment
Share on other sites

 

(setq lst nil)
(if (and (setq ent (car (entsel))) (eq (cdr (assoc 0 (entget ent))) "LWPOLYLINE"))
	(progn
		(setq pa (if (vlax-curve-IsClosed ent) (vlax-curve-getEndParam ent) (+ (vlax-curve-getEndParam ent) 1)))
		(while (setq pt (vlax-curve-getPointAtParam ent (setq pa (- pa 1))))
			(setq lst (cons pt lst))
		)
	)
)


(vl-cmdf "_AeccDeleteSurfaceLine" "F" lst)

 

 

The first part selects the polyline and extracts vertex coordinates to a list 

I need to delete lines from the surface using the command "_AeccDeleteSurfaceLine" with parameter "F" fence

Test.dwg

  • Like 1
Link to comment
Share on other sites

"The first part selects the polyline and extracts vertex coordinates to a list " ok a list would normally not have the "," seperating the X & Y. If you want to use X,Y then it needs to be a string.

 

(setq plent (entsel "\nPick rectang"))
(if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))))

 

((413540.0514 2885464.6320) (413537.4807 2885455.1222)  (413535.0813 2885449.2106))

or

("413540.0514,2885464.6320" "413537.4807,2885455.1222" "413535.0813,2885449.2106")

The other way is using something like this change pline to "_AeccDeleteSurfaceLine" need a couple more""

(defun AHpllst ( lst / x)
(command "_pline")
(while (= (getvar "cmdactive") 1 )
(repeat (setq x (length lst))
(command (nth (setq x (- x 1)) lst))
)
(command "")
)
)

 Sorry not tested.

Edited by BIGAL
  • Thanks 1
Link to comment
Share on other sites

10 hours ago, BIGAL said:

"The first part selects the polyline and extracts vertex coordinates to a list " ok a list would normally not have the "," seperating the X & Y. If you want to use X,Y then it needs to be a string.

 

(setq plent (entsel "\nPick rectang"))
(if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))))

 

((413540.0514 2885464.6320) (413537.4807 2885455.1222)  (413535.0813 2885449.2106))

or

("413540.0514,2885464.6320" "413537.4807,2885455.1222" "413535.0813,2885449.2106")

The other way is using something like this change pline to "_AeccDeleteSurfaceLine" need a couple more""

(defun AHpllst ( lst / x)
(command "_pline")
(while (= (getvar "cmdactive") 1 )
(repeat (setq x (length lst))
(command (nth (setq x (- x 1)) lst))
)
(command "")
)
)

 Sorry not tested.

 

 

(command "_pline")
(while (= (getvar "cmdactive") 1 )
(repeat (setq x (length lst))
(command (nth (setq x (- x 1)) lst))
)
(command "")
)
)

 

 

Perfect .. This command solved the issue. Thanks 🌹

 

Edited by SLW210
Added Code Tags!!
Link to comment
Share on other sites

1 hour ago, SLW210 said:

Please use Code Tags in the future. (<> in the editor toolbar)

 

Ok 🙏

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...