Engineer_Yasser Posted September 11 Share Posted September 11 (edited) 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 September 12 by SLW210 AddedCode Tags!! Quote Link to comment Share on other sites More sharing options...
kirby2 Posted September 11 Share Posted September 11 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 Quote Link to comment Share on other sites More sharing options...
Engineer_Yasser Posted September 11 Author Share Posted September 11 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 Quote Link to comment Share on other sites More sharing options...
pkenewell Posted September 11 Share Posted September 11 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 "" "" "") Quote Link to comment Share on other sites More sharing options...
Engineer_Yasser Posted September 11 Author Share Posted September 11 (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 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 12 Share Posted September 12 (edited) "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 September 12 by BIGAL 1 Quote Link to comment Share on other sites More sharing options...
Engineer_Yasser Posted September 12 Author Share Posted September 12 (edited) 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 September 12 by SLW210 Added Code Tags!! Quote Link to comment Share on other sites More sharing options...
SLW210 Posted September 12 Share Posted September 12 Please use Code Tags in the future. (<> in the editor toolbar) 1 Quote Link to comment Share on other sites More sharing options...
Engineer_Yasser Posted September 12 Author Share Posted September 12 1 hour ago, SLW210 said: Please use Code Tags in the future. (<> in the editor toolbar) Ok Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.