Jump to content

entmake solid ellipse


rlx

Recommended Posts

I'm building an application for isometric dimensioning. I can entmake all the normal arrow heads without any problem. I also can entmake an ellipse. But when I tried to entmake a solid ellipse I got stuck. Eventualy I want to entmake the solid ellipse (or hatch) into a block.

 

 

 

When I draw an ellipse and create a solid hatch of it I see this data :

 

Select object: ((-1 . ) (0 . HATCH) (330 .

7ef01cf8>) (5 . 22AC) (100 . AcDbEntity) (67 . 0) (410 . Model) (8 . 0) (100 .

AcDbHatch) (10 0.0 0.0 0.0) (210 0.0 0.0 1.0) (2 . SOLID) (70 . 1) (71 . 1) (91

. 1) (92 . 1) (93 . 1) (72 . 3) (10 0.0 0.0 0.0) (11 -0.612372 3.74958e-017

0.0) (40 . 0.57735) (50 . 0.0) (51 . 6.28319) (73 . 1) (97 . 1) (330 .

name: 7ef03488>) (75 . 1) (76 . 1) (98 . 1) (10 0.0 0.0 0.0) (450 . 0) (451 .

0) (460 . 0.0) (461 . 0.0) (452 . 0) (462 . 1.0) (453 . 2) (463 . 0.0) (63 . 5)

(421 . 255) (463 . 1.0) (63 . 2) (421 . 16776960) (470 . LINEAR))

 

after group 97 is the name of the ellipse. So I entmade the ellipse and tried to add its entity number as a 330 group into the entmake for the hatch. And this doesn't seem to be possible.

 

The only other way seems to be converting the ellipse to a point-list or just use the standard autocad commands but I just want to know if it is possible at all to pass an entity name as boundary data to entmake or not.

 

Anyone?

 

 

RLX

Edited by rlx
Link to comment
Share on other sites

Welcome to CADTutor rlx! :)

 

Although theoretically possible to achieve using entmake(x), generation of a hatch entity is far easier using the ActiveX (COM) methods of Visual LISP - here is a quick example to demonstrate:

(defun c:hatchtest ( / cen hat maj mni rat spc )
   (if
       (and
           (setq cen (getpoint     "\nSpecify ellipse center: "))
           (setq maj (getpoint cen "\nSpecify major axis endpoint: "))
           (setq mni (getpoint cen "\nSpecify minor axis length: "))
       )
       (progn
           (if (< 1.0 (setq rat (/ (distance cen mni) (distance cen maj))))
               (mapcar 'set
                  '( mni maj rat )
                   (list maj mni (/ 1.0 rat))
               )
           )
           (vla-appendouterloop
               (setq hat
                   (vla-addhatch
                       (setq spc
                           (vlax-get-property (vla-get-activedocument (vlax-get-acad-object))
                               (if (= 1 (getvar 'cvport))
                                   'paperspace
                                   'modelspace
                               )
                           )
                       )
                       achatchpatterntypepredefined
                       "SOLID"
                       :vlax-true
                       achatchobject
                   )
               )
               (vlax-make-variant
                   (vlax-safearray-fill (vlax-make-safearray vlax-vbobject '(0 . 0))
                       (list
                           (vla-addellipse spc
                               (vlax-3D-point (trans cen 1 0))
                               (vlax-3D-point (trans (mapcar '- maj cen) 1 0))
                               rat
                           )
                       )
                   )
               )
           )
           (vla-evaluate hat)
       )
   )
   (princ)
)
(vl-load-com) (princ)
 
Edited by Lee Mac
Edited to remove BBCode
Link to comment
Share on other sites

I don't say this very often (actually never) but you realy are my hero! Are you by any chance an alien with a superior IQ? ;-)

 

 

thanx man!

Edited by rlx
Link to comment
Share on other sites

Thank you for your flattering compliments rlx, that's very kind of you to say -

But where programming is concerned in the great scheme of things, I'm only a small fish in a very big pond :)

Link to comment
Share on other sites

I'm only a small fish in a very big pond :)

:nono: you are not!! because the rest of us don't wanna be tadpoles or larvas :rofl:

you are the giant whale among us!!! :notworthy:

Link to comment
Share on other sites

:nono: you are not!! because the rest of us don't wanna be tadpoles or larvas :rofl:

you are the giant whale among us!!! :notworthy:

 

Haha! - thank you hanhphuc :)

My point was more that AutoLISP is merely the very tip of the programming iceberg :thumbsup:

Link to comment
Share on other sites

attachment.php?attachmentid=51528&cid=1&stc=1

 

I work at sabic (former GE) in Bergen op Zoom , Netherlands) and my collegues stil work with isomectric's , cutting and pasting dimensions by hand , so I've decided to do someting about it and built an interface , but 'the dot' stood in my way haha , not any more , thanx to Lee.

 

 

Edited by rlx
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...