elfert Posted February 20, 2012 Author Share Posted February 20, 2012 (edited) Thx pBE. Does this mean that this routine that you wrote can be used with line, poly line, lw poly lines and 3D polyline, very nice that is exactly what i need? Please if you can do a ;; around the lisp i could lean something. But i must say many thanks what you have done so far. I still need the file to be "W" rite so no append to the file. And another thing is that when i make a selection of Lines let we say 3 lines i need the coordinates in this manor to the file: S X= Y= Z= E X= Y= Z= S X= Y= Z= E X= Y= Z= S X= Y= Z= E X= Y= Z= The way that you have done it with the poly lines, LW poly lines,3d poly lines ect. i just grate, But when it is lines that is selected the output to the file should be like the one mentioned over here. Edited February 20, 2012 by elfert Quote Link to comment Share on other sites More sharing options...
pBe Posted February 21, 2012 Share Posted February 21, 2012 CODE Upated I still need the file to be "W" rite so no append to the file. .... Check And another thing is that when i make a selection of Lines let we say 3 lines i need the coordinates in this manor to the file:.... Check Please if you can do a ;; around the lisp i could lean something..... As much as i wanted to comment every line of the code.. i dont have time. and to tell you the truth, i just write the code as i see it. in time you will know what works and what doesnt. so what i do is ...>>>> Cheers Quote Link to comment Share on other sites More sharing options...
Kapanther Posted May 1, 2012 Share Posted May 1, 2012 How can I add a column to include an "identifier" for which polyline the x,y coord comes from? Fox example? could you add a column for the acad handle maybe? or a "count" as it moves through each polyline? Thanks for your help! Quote Link to comment Share on other sites More sharing options...
pBe Posted May 1, 2012 Share Posted May 1, 2012 (edited) Yes YOU can This code feels like ages ago. I need to have look-see at the code i posted Hang on.... Edited May 1, 2012 by pBe Quote Link to comment Share on other sites More sharing options...
Kapanther Posted May 1, 2012 Share Posted May 1, 2012 Indeed.. Thanks for your help! Quote Link to comment Share on other sites More sharing options...
pBe Posted May 1, 2012 Share Posted May 1, 2012 Will it look like this for every line? [color=blue][b]B49F[/b][/color] at point X =14805.2190 Y= 4837.2547 Z= 0.0000 [color=blue][b]B49F [/b][/color]at point X =19030.0596 Y= 10922.8723 Z= 0.0000 or [b][color=blue]B49F[/color][/b] at point X =14805.2190 Y= 4837.2547 Z= 0.0000 [color=white]_____[/color][color=black]at point X =19030.0596 Y= 10922.8723 Z= 0.0000 [/color] Quote Link to comment Share on other sites More sharing options...
Kapanther Posted May 1, 2012 Share Posted May 1, 2012 B49F at point X =14805.2190 Y= 4837.2547 Z= 0.0000 B49F at point X =19030.0596 Y= 10922.8723 Z= 0.0000 is fine B49F,14805.2190,4837.2547,0.0000 B49F,19030.0596,10922.8723,0.0000 is better No need to stop the handle sounds like oyu got it Quote Link to comment Share on other sites More sharing options...
Kapanther Posted May 1, 2012 Share Posted May 1, 2012 Gimme Gimme Gimme!!! hehe thanks for your help!! Quote Link to comment Share on other sites More sharing options...
pBe Posted May 1, 2012 Share Posted May 1, 2012 Gimme Gimme Gimme!!! hehe thanks for your help!! Hold your horses Kapanther . You do realize that the code wirtes to a specific file on a specific folder and drive letter. Do you want to maintain that? Quote Link to comment Share on other sites More sharing options...
Kapanther Posted May 1, 2012 Share Posted May 1, 2012 Hehe I can modify as necessary. Thanks for help Quote Link to comment Share on other sites More sharing options...
Kapanther Posted May 1, 2012 Share Posted May 1, 2012 You have me waiting in suspense! Quote Link to comment Share on other sites More sharing options...
pBe Posted May 1, 2012 Share Posted May 1, 2012 (edited) Hehe I can modify as necessary. Thanks for help You can modify the rest then (defun c:vlplexport (/ AT:GetVertices _dxf theobj[b][color=blue]s[/color][/b] [b][color=blue]i [/color][/b]fn thelist f) (defun AT:GetVertices (e / p l) ;; Return point at each vertex of curve ;; e - curve to evaluate (Arc, Line, *Polyline, Spline) ;; Alan J. Thompson, 09.30.10 (if e (if (eq (setq p (vlax-curve-getEndParam e)) (fix p)) (repeat (setq p (1+ (fix p))) (setq l (cons (vlax-curve-getPointAtParam e (setq p (1- p))) l)) ) (list (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e)) ) ) ) (defun _dxf (ent dx)(cdr (assoc dx (entget ent)))) (prompt "\nSelect a [b][color=blue]Polyline/Lines for data export[/color][/b]: ") [color=blue][b](if (and[/b][/color] (setq theobjs (ssget '((0 . "*LINE")))) (not (vl-mkdir "c:/User")) (setq fn (open (setq f "c:/user/infile.txt") "w"))[b][color=blue])[/color][/b] [color=blue][b](progn (repeat (setq i (sslength theobjs)) [/b][/color] (setq thelist (if (eq (_dxf (setq e (ssname [color=blue][b]theobjs (setq i (1- i))[/b][/color])) 0) "LINE") (list (cons (_dxf e 5)(_dxf e 10)) (cons (_dxf e 5)(_dxf e 11))) (mapcar '(lambda (j)(cons (_dxf e 5) j)) (AT:GetVertices e)))) (foreach itm thelist (write-line (strcat (car itm) "," (rtos (Cadr itm) 2 4) "," (rtos (Caddr itm) 2 4) "," (rtos (last itm) 2 4)) fn) ) ) (close fn) (startapp "notepad" f) )[b][color=blue](princ "\nNo Entities to process") )[/color][/b] (vla-regen (vla-get-ActiveDocument (vlax-get-acad-object)) acActiveViewport) (princ) ) HTH Edited May 2, 2012 by pBe Updated for mulitple selection Quote Link to comment Share on other sites More sharing options...
pBe Posted May 1, 2012 Share Posted May 1, 2012 So Kapanther, did it work for you? You have me waiting in suspense! Quote Link to comment Share on other sites More sharing options...
Kapanther Posted May 2, 2012 Share Posted May 2, 2012 Yeah it worked! Although I forgot this lisp only does it for one polyline. How hard is to do on multiple polylines? ? Quote Link to comment Share on other sites More sharing options...
pBe Posted May 2, 2012 Share Posted May 2, 2012 Yeah it worked! Although I forgot this lisp only does it for one polyline. How hard is to do on multiple polylines? ? Its not really just for one polyline, as long as you keep selecting a valid entity (Line/Polyline/Lwpolyline) the program will continue. Also, take note that it overwrites the previous data whenever you run the program on another set of objects. the "W" argument for open does that. Anyhoo. i updated the code for multiple selection mode. [/color][/b] Quote Link to comment Share on other sites More sharing options...
Kapanther Posted May 2, 2012 Share Posted May 2, 2012 Nice work fella. Works a treat!!!!!! I owe you one.! Quote Link to comment Share on other sites More sharing options...
pBe Posted May 2, 2012 Share Posted May 2, 2012 Nice work fella.Works a treat!!!!!! I owe you one.! Good for you Kapanther, The way i see it. you owe this forum more than you do me. Glad i could help, Cheers Quote Link to comment Share on other sites More sharing options...
SolarPVDesigner Posted May 9, 2012 Share Posted May 9, 2012 I'm running the routine by Alan J. Thompson, 09.30.10 but I need it to follow my UCS. Right now it's only working off WCS. I'm getting back into AutoLISP after a 15 year hiatus and trying to determine if I can get the "Tran" command to work for this. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 9, 2012 Share Posted May 9, 2012 I'm running the routine by Alan J. Thompson, 09.30.10 but I need it to follow my UCS. Right now it's only working off WCS. I'm getting back into AutoLISP after a 15 year hiatus and trying to determine if I can get the "Tran" command to work for this. Which code are you referring to SolarPVDesigner? Quote Link to comment Share on other sites More sharing options...
pBe Posted May 10, 2012 Share Posted May 10, 2012 (edited) Guess he meant AT:GetVertices No need to modify the function but instead apply trans on the result of the function (setq _trans (lambda (pt) (trans pt 0 1))) (setq ss (AT:GetVertices (car (entsel)))) (setq pts (mapcar '_trans ss));<-- translated point list HTH EDIT:Unless Alanjt decides to incorporate the trans within his sub Edited May 10, 2012 by pBe 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.