rlx Posted November 6, 2014 Posted November 6, 2014 (edited) 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 April 24, 2018 by rlx Quote
Lee Mac Posted November 6, 2014 Posted November 6, 2014 (edited) 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 October 2, 2018 by Lee Mac Edited to remove BBCode Quote
rlx Posted November 7, 2014 Author Posted November 7, 2014 (edited) 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 May 22, 2018 by rlx Quote
Lee Mac Posted November 7, 2014 Posted November 7, 2014 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 Quote
hanhphuc Posted November 7, 2014 Posted November 7, 2014 I'm only a small fish in a very big pond you are not!! because the rest of us don't wanna be tadpoles or larvas you are the giant whale among us!!! Quote
Lee Mac Posted November 7, 2014 Posted November 7, 2014 you are not!! because the rest of us don't wanna be tadpoles or larvas you are the giant whale among us!!! Haha! - thank you hanhphuc My point was more that AutoLISP is merely the very tip of the programming iceberg Quote
rlx Posted November 7, 2014 Author Posted November 7, 2014 (edited) 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 January 24, 2020 by rlx Quote
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.