Jump to content

for geting ellipse minor and major width.


raj patel

Recommended Posts

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.....

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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])

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...