royDC Posted March 2, 2005 Share Posted March 2, 2005 I new to vector script. Trying to create some plug-in objects to expedite kitchen design. I am having trouble figuring out how to assign a hatch fill to a rectangle drawn within the script of my plugin. Here is a sample of a cabinet script: PROCEDURE CabinetTest; VAR carc_w : REAL; carc_d : REAL; carc_h : REAL; toe_h : REAL; BEGIN carc_w := PCarcase_Width; carc_d := PCarcase_Depth; NameClass('CarcaseMat'); PenPat(-5); rect(0,carc_d,19mm,0); rect(carc_w-19mm,carc_d,carc_w,0); rect(0,0,carc_w,-20mm); rect(19mm,carc_d-21mm,carc_w-19mm,carc_d-25mm); Moveto(19mm,carc_d); line(carc_w-19mm,0 ); END; RUN(CabinetTest); ___________________ Do I need to use SetVectorFill to assign my hatch? If so, I have no trouble accessing the hatches i have already defined in my document by name, but i can't seem to locate or define a handle for the rectangle i am trying to add a hatch to. Can anyone help here? Seems like this should be very easy . . . Thanks, RoyDC Quote Link to comment
MullinRJ Posted March 2, 2005 Share Posted March 2, 2005 It looks like you are doing this in a PIO. If so, use: BoolResult := GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand); to return a handle to thePIO you are creating. I think myHnd:=FIn3D(objectHand); should return a handle to the first object you created (as numbered below). rect(0,carc_d,19mm,0); { 1 } rect(carc_w-19mm,carc_d,carc_w,0); { 2 } rect(0,0,carc_w,-20mm); { 3 } rect(19mm,carc_d-21mm,carc_w-19mm,carc_d-25mm); { 4 } Moveto(19mm,carc_d); line(carc_w-19mm,0); { 5 } Test myHnd before using it. if (myHnd<>nil) then begin end; Use myHnd:=NextObj(myHnd); to get the second object, etc. If you are in a normal script, use myHnd:=LNewObj; to return a handle to the last object you created (i.e., the line), and use myHnd:=PrevObj(myHnd); to get the second to the last object, etc. These suggestions are off the top of my head, so use with caution. Raymond Quote Link to comment
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.