justindm Posted December 21, 2010 Share Posted December 21, 2010 I'm looking for a way to extract the X, Y and Z values from a set of selected blocks (there may be several types of blocks) and then have it export to a txt file. I'm not sure if it's possible but I'd like to have it export in the order that the blocks were placed. The format I'm looking for would be like this: x,y,z x,y,z and so on... I can do it in Microstation but would prefer an Autcad Lisp. Any help is really appreciated!!!!! Quote Link to comment Share on other sites More sharing options...
alanjt Posted December 21, 2010 Share Posted December 21, 2010 What determines how they were placed? This isn't very difficult to code, what do you have so far? Quote Link to comment Share on other sites More sharing options...
eldon Posted December 21, 2010 Share Posted December 21, 2010 Before you go for lisp, have you tried the Attribute Extraction Tool. This enables the insertion point of blocks to be exported, and I believe it lists the blocks in the order of creation. If that fails then by all means go the lisp route. Quote Link to comment Share on other sites More sharing options...
alanjt Posted December 21, 2010 Share Posted December 21, 2010 Before you go for lisp, have you tried the Attribute Extraction Tool. This enables the insertion point of blocks to be exported, and I believe it lists the blocks in the order of creation. If that fails then by all means go the lisp route. Excellent suggestion. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted December 21, 2010 Share Posted December 21, 2010 This perhaps? http://lee-mac.com/ptmanager.html Quote Link to comment Share on other sites More sharing options...
LGarduno Posted December 21, 2010 Share Posted December 21, 2010 We use the EATTEXT command to extract that info. Quote Link to comment Share on other sites More sharing options...
JPlanera Posted December 21, 2010 Share Posted December 21, 2010 We use the EATTEXT command to extract that info. who would want to EAT TEXT? thats gross and i think impossible... Quote Link to comment Share on other sites More sharing options...
LGarduno Posted December 21, 2010 Share Posted December 21, 2010 who would want to EAT TEXT? thats gross and i think impossible... You got me, I will give you that. That is how we get points out to place into a TotalStation to place sleves and hanger inserts. Quote Link to comment Share on other sites More sharing options...
JPlanera Posted December 21, 2010 Share Posted December 21, 2010 Phew... I was concerned because of the high trans fat... Its good you have found an alternate use.. LOL Quote Link to comment Share on other sites More sharing options...
eldon Posted December 21, 2010 Share Posted December 21, 2010 Phew... I was concerned because of the high trans fat... Its good you have found an alternate use.. LOL What a comedian I suppose you now want to poke fun at all the peculiar AutoCAD commands. I suppose a Moderator could expunge all the irrelevant posts. Quote Link to comment Share on other sites More sharing options...
JPlanera Posted December 21, 2010 Share Posted December 21, 2010 no no. the holidays put me in a peculiar mood. I apologize, and will be more professional. and if i feel the need to poke fun at autocad commands, a dedicated thread will be started in its respective place.. that gives me an idea.. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 21, 2010 Share Posted December 21, 2010 Check this out ... (defun c:THex (/ fNme ss) ; THARWAT 2010 (if (and (setq fNme (open "D:/Block-coordinates.txt" "w")) (setq ss (ssget "_:L" '((0 . "INSERT")))) ) ( (lambda (i / ss1 e pt1 ) (while (setq ss1 (ssname ss (setq i (1+ i)))) (setq e (entget ss1)) (setq pt1 (cdr (assoc 10 e))) (write-line (strcat (rtos (car pt1) 2) "," (rtos (cadr pt1) 2) "," (rtos (caddr pt1) 2)) fNme) ) ) -1 ) (princ) ) (close fNme) (princ "\n Written by Tharwat") (princ) ) Good luck. Tharwat Quote Link to comment Share on other sites More sharing options...
alanjt Posted December 21, 2010 Share Posted December 21, 2010 Where do you write your code? Your formatting gives me a headache. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 21, 2010 Share Posted December 21, 2010 Where do you write your code? Your formatting gives me a headache. I have just finished writting them at the office . And they are simple and you do know that of course , so where did the headache come from ? Thanks Tharwat Quote Link to comment Share on other sites More sharing options...
alanjt Posted December 21, 2010 Share Posted December 21, 2010 I have just finished writting them at the office . And they are simple and you do know that of course , so where did the headache come from ? Thanks Tharwat The formatting. I meant, in what program do you write your code? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 21, 2010 Share Posted December 21, 2010 The attached Vlisp editor with Autocad .(vlide) Quote Link to comment Share on other sites More sharing options...
alanjt Posted December 21, 2010 Share Posted December 21, 2010 The attached Vlisp editor with Autocad .(vlide)Look into the Format Selection button. It's your code, I'm just commenting that it's incredibly hard to read. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 21, 2010 Share Posted December 21, 2010 Look into the Format Selection button. It's your code, I'm just commenting that it's incredibly hard to read. Is it due to the unordering way ? I mean, each sentence should be completed in a line to be clear for some people to read them well ? Things like .( for example ) (setq pt (getpoint "\n Specify Point :")) Not like the way I used like .... (setq pt (getpoint "\n Specify Point :") ) Is this what you mean ? Quote Link to comment Share on other sites More sharing options...
alanjt Posted December 21, 2010 Share Posted December 21, 2010 Is it due to the unordering way ? I mean, each sentence should be completed in a line to be clear for some people to read them well ? Things like .( for example ) (setq pt (getpoint "\n Specify Point :")) Not like the way I used like .... (setq pt (getpoint "\n Specify Point :") ) Is this what you mean ? No, look at your code. The parens don't match, they don't even make sense. Perhaps it's just a result of you using tabs and forum code brackets don't work well with them. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 21, 2010 Share Posted December 21, 2010 No, look at your code. The parens don't match, they don't even make sense. Perhaps it's just a result of you using tabs and forum code brackets don't work well with them. But in my Vlisp editor they are matched completely . Have you tried the routine ? What about the outcome of it ? 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.