samifox Posted March 25, 2014 Share Posted March 25, 2014 hi i need to make entities in a loop, the location needs to be updated , how can i insert "live" data into the quoted list? (defun caseA (tot seg ang / i) (setq i 0) (while (<= i (- (fix (/ tot seg)) 2)) (entmake '((0 . "POINT") (5 . "275") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbPoint") [color="red"][b](strcat "(10 . " (polar i seg ang))[/b][/color] ) ) ) ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted March 25, 2014 Share Posted March 25, 2014 Hi , i = point ( x y ) with Z or without . ang = Angle in radians . seg = distance (entmake (list '(0 . "POINT") '(8 . "0") (cons 10 (polar i ang seg)) ) ) Quote Link to comment Share on other sites More sharing options...
samifox Posted March 25, 2014 Author Share Posted March 25, 2014 Hi , i = point ( x y ) with Z or without . ang = Angle in radians . seg = distance (entmake (list '(0 . "POINT") '(8 . "0") (cons 10 (polar i ang seg)) ) ) Thanks you! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted March 26, 2014 Share Posted March 26, 2014 Thank you! You're welcome . Don't hesitate to ask if you have any further question . Quote Link to comment Share on other sites More sharing options...
samifox Posted March 30, 2014 Author Share Posted March 30, 2014 You're welcome . Don't hesitate to ask if you have any further question . again , i want to create a sset only of the entites that has the same layer as the first picked entity, when i try to retrvie that item in the list i get an error (defun C:Test(/ ent entLay ) (setq ent (entget(car(entsel)))) (ssget '((0 . "LINE") (assoc 8 ent))) ) THanks (like your new avatar Tharwat:)) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted March 30, 2014 Share Posted March 30, 2014 (like your new avatar Tharwat:)) Thank you , happy to hear Back to your question , you need to replace the quote with list function , read about functions QUOTE and LIST . Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 30, 2014 Share Posted March 30, 2014 This tutorial may help: The Apostrophe and the Quote Function Quote Link to comment Share on other sites More sharing options...
samifox Posted March 30, 2014 Author Share Posted March 30, 2014 Thank you , happy to hear Back to your question , you need to replace the quote with list function , read about functions QUOTE and LIST . (defun C:Test(/ ent entLay ) (setq ent (entget(car(entsel)))) (ssget (list '(0 . "LINE") (assoc 8 ent))) ) Thankss DUD! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted March 30, 2014 Share Posted March 30, 2014 Correct , try to use IF function to avoid any error message that may occur if a user picked nothing . Quote Link to comment Share on other sites More sharing options...
samifox Posted April 18, 2014 Author Share Posted April 18, 2014 This tutorial may help: The Apostrophe and the Quote Function Thank you LEE very interesting tutorial! Quote Link to comment Share on other sites More sharing options...
samifox Posted April 21, 2014 Author Share Posted April 21, 2014 hi now i have problem to insert list of points into entmake what im trying to do is ask user to select hatch get all its vertices as vertexlist send vertexlist to make wipeout make wipeout using vertexlist (defun C:TEST (/ ent vertex vertexList f) (while (not f) (if (setq ent (entget (car (entsel)))) (if (= (cdr (assoc 0 ent)) "HATCH") (progn (setq f T) (foreach vertex ent (if (= (car vertex) 10) (setq vertexList (cons (cdr vertex) vertexList)) ) (reverse vertexList) (makeWout vertexList) ) ;_progn ) ) ) ) ) (defun makeWout (vertexList) (entmakex (list '(0 . "WIPEOUT") '(100 . "AcDbEntity") '(410 . "Model") '(8 . "0") '(100 . "AcDbWipeout") (mapcar '(lambda (a) (cons 14 a)) vertexList) ) ) ) Quote Link to comment Share on other sites More sharing options...
pBe Posted April 22, 2014 Share Posted April 22, 2014 ---> (entmake)’ing a wipeout Quote Link to comment Share on other sites More sharing options...
samifox Posted April 22, 2014 Author Share Posted April 22, 2014 ---> (entmake)’ing a wipeout thanks, so is it possible to paste a list into entmake? Quote Link to comment Share on other sites More sharing options...
pBe Posted April 22, 2014 Share Posted April 22, 2014 thanks, so is it possible to paste a list into entmake? for your general question, YES. use append Like so --->(append '(1 2 3) (list 4 5 6)) '(1 2 3) as the literal list and (list 4 5 6) as the result of mapcar function you have on your code. Quote Link to comment Share on other sites More sharing options...
samifox Posted April 22, 2014 Author Share Posted April 22, 2014 for your general question, YES. use append Like so --->(append '(1 2 3) (list 4 5 6)) '(1 2 3) as the literal list and (list 4 5 6) as the result of mapcar function you have on your code. Thank you Patrick! 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.