InsertLoopAt method of a Hatch

InsertLoopAt method of a Hatch

tcorey
Mentor Mentor
435 Views
4 Replies
Message 1 of 5

InsertLoopAt method of a Hatch

tcorey
Mentor
Mentor

Hello geniuses,

 

A hatch object has a method called InsertLoopAt (3). Does anyone have a reference  for this method? I can't figure out what it's asking for. I am giving it points and am getting a mismatch error.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Platinum Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
0 Likes
436 Views
4 Replies
Replies (4)
Message 2 of 5

TerryDotson
Mentor
Mentor

I've never used that, but I do remember that hatch creation code require operations somewhat in a particular order, more restrictive than you would think.   This being a generic AutoCAD .NET related item, you would be better off searching and posting in that forum.

 

https://forums.autodesk.com/t5/net/bd-p/152

0 Likes
Message 3 of 5

Jeff_M
Consultant
Consultant

@tcorey Tim, I'm guessing you are asking about doing this in lisp. The ActiveX docs has an example of using this method here:

https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-E35E3387-14E8-433D-B6A6-82E034A11BEE

I'm not sure why many of the lisp lines of code are commented out, but it should help.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 4 of 5

tcorey
Mentor
Mentor

Thanks, @Jeff_M . I will try to figure it out from what you linked. My goal is to be able to select text objects and have them added as Islands in an existing Hatch.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Platinum Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
0 Likes
Message 5 of 5

Jeff_M
Consultant
Consultant

@tcorey Use the AppendInnerLoop method:

(setq hatch (vl-sel));;just a helper routine to entsel an object and convert to vla-object
(setq txt (vl-sel))
(setq innerLoop1 (vlax-make-safearray vlax-vbObject '(0 . 0)))
(vlax-safearray-put-element innerLoop1 0 txt)
(vla-AppendInnerLoop hatch innerLoop1)
(vla-Evaluate hatch)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vla-Regen doc :vlax-true)
Jeff_M, also a frequent Swamper
EESignature
0 Likes