raj patel Posted April 23, 2016 Share Posted April 23, 2016 hello sir, I have a selection set consists of number of ellipse I want to get center point, minor width and major width of each ellipse and stored in excel file. please help regarding this..... Quote Link to comment Share on other sites More sharing options...
raj patel Posted April 23, 2016 Author Share Posted April 23, 2016 hello sir, I have a selection set consists of number of ellipse I want to get center point, minor width and major width of each ellipse and stored in excel file. please help regarding this..... If it is possible to get ellipse dimension from 3D parts with number of elliptical hole than also give solution... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 23, 2016 Share Posted April 23, 2016 Try the following: ([color=BLUE]defun[/color] c:e2csv ( [color=BLUE]/[/color] e f i r s ) ([color=BLUE]and[/color] ([color=BLUE]setq[/color] s ([color=BLUE]ssget[/color] '((0 . [color=MAROON]"ELLIPSE"[/color])))) ([color=BLUE]setq[/color] f ([color=BLUE]getfiled[/color] [color=MAROON]"Create CSV File"[/color] [color=MAROON]""[/color] [color=MAROON]"csv"[/color] 1)) ([color=BLUE]setq[/color] f ([color=BLUE]open[/color] f [color=MAROON]"w"[/color])) ([color=BLUE]write-line[/color] [color=MAROON]"CX,CY,CZ,MAJ,MIN"[/color] f) ([color=BLUE]repeat[/color] ([color=BLUE]setq[/color] i ([color=BLUE]sslength[/color] s)) ([color=BLUE]setq[/color] e ([color=BLUE]entget[/color] ([color=BLUE]ssname[/color] s ([color=BLUE]setq[/color] i ([color=BLUE]1-[/color] i)))) r ([color=BLUE]distance[/color] '(0.0 0.0 0.0) ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 11 e))) ) ([color=BLUE]write-line[/color] (LM:lst->str ([color=BLUE]mapcar[/color] '[color=BLUE]rtos[/color] ([color=BLUE]append[/color] ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 10 e)) ([color=BLUE]list[/color] r ([color=BLUE]*[/color] r ([color=BLUE]cdr[/color] ([color=BLUE]assoc[/color] 40 e)))))) [color=MAROON]","[/color]) f) ) ([color=BLUE]close[/color] f) ) ([color=BLUE]princ[/color]) ) [color=GREEN];; List to String - Lee Mac[/color] [color=GREEN];; Concatenates each string in a supplied list, separated by a given delimiter[/color] [color=GREEN];; lst - [lst] List of strings to concatenate[/color] [color=GREEN];; del - [str] Delimiter string to separate each item[/color] ([color=BLUE]defun[/color] LM:lst->str ( lst del [color=BLUE]/[/color] str ) ([color=BLUE]setq[/color] str ([color=BLUE]car[/color] lst)) ([color=BLUE]foreach[/color] itm ([color=BLUE]cdr[/color] lst) ([color=BLUE]setq[/color] str ([color=BLUE]strcat[/color] str del itm))) str ) ([color=BLUE]princ[/color]) Quote Link to comment Share on other sites More sharing options...
ymg3 Posted April 23, 2016 Share Posted April 23, 2016 rajpatel, When you say 3d parts. Do you mean that the entities are solids ? ymg 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.