Jump to content

Hole in path Pio


Recommended Posts

1. If you define the path with 2DReshape tool so that the edges "to" the hole are visible, you should be OK.

2. If you want to use "Clip Surface" etc. the PIO needs to be "event-enabled".

3. If you want to use the "Objects from Polyline"-command, the SAID COMMAND MUST BE MODIFIED, WHICH MEANS THAT YOUR SPACE-OBJECT CAN'T BE USED BY ANYONE ELSE UNLESS... (Shocking, absolutely shocking. I wonder if even Autodesk has ever resorted to THIS LOW tactics...)

Link to comment

Here is the code:

PROCEDURE Space; { ? Petri Sakkinen 2002 }

CONST

kObjOnInitXProperties = 5;

kResetEventID = 3;

kObjXPropSpecialEdit = 3;

kDefaultSpecialEdit = 0;

kCustomSpecialEdit = 1;

kPropertiesSpecialEdit = 2;

kReshapeSpecialEdit = 3;

kObjXIs2DSurfaceEligible = 14;

VAR

theEvent, theButton :LONGINT;

fID : INTEGER;

result :BOOLEAN;

objHand, recHand, wallHand, pathHand, dupeHand :HANDLE;

objName, spaceArea, spacePerim, spaceGroup, labelText, font :STRING;

x, y, x1, y1, x2, y2, rotA, tagA : REAL;

PROCEDURE MakeTag;

BEGIN

IF PTAGSPACENO THEN labelText:=CONCAT(PSPACENO, ' ', CHR(13));

IF PTAGSPACENAME THEN labelText:=CONCAT(labelText, PSPACENAME, CHR(13))

ELSE labelText:=CONCAT(labelText, CHR(13));

IF PTAGSPACEAREA THEN labelText:=CONCAT(labelText, 'A: ', spaceArea, ' m? ', CHR(13));

IF PTAGSPACEPERIM THEN labelText:=CONCAT(labelText, 'U: ', spacePerim, ' m ', CHR(13));

IF PTAGGROUP THEN labelText:=CONCAT(labelText, spaceGroup, CHR(13));

IF PTAGLAYER THEN labelText:=CONCAT(labelText, GETLNAME(GETLAYER(dupeHand)));

x:=PCONTROLPOINT01X;

y:=PCONTROLPOINT01Y;

tagA:= PTAGANGLE;

rotA:=GETSYMROT(dupeHand);

font:=PFONT;

IF NOT(font='Default') THEN BEGIN

fID:=GETFONTID(font);

TEXTFONT(fID);

END;

TEXTROTATE(tagA-rotA);

NAMECLASS('TAGS');

TEXTJUST(1);

TEXTVERTICALALIGN(1);

TEXTSIZE(PTEXTSIZE);

FILLPAT(0);

TEXTORIGIN(x, y);

CREATETEXT(labelText);

END;

BEGIN

vsoGetEventInfo(theEvent, theButton);

CASE theEvent OF

{User has single-clicked the object's icon.}

kObjOnInitXProperties:

BEGIN

{This defines the double-click behavior to active the 2D Reshape tool.}

result := SetObjPropCharVS(kObjXPropSpecialEdit, Chr(kReshapeSpecialEdit));

result := SetObjPropVS(kObjXIs2DSurfaceEligible, TRUE);

END;

{Object reset has been called.}

kResetEventID:

BEGIN

IF GetCustomObjectInfo(objName, objHand, recHand, wallHand) THEN BEGIN

pathHand := GetCustomObjectPath(objHand);

dupeHand := CreateDuplicateObject(pathHand, objHand);

spaceArea:=NUM2STR(2, HAREA(dupeHand)/10000);

spacePerim:=NUM2STR(2, HPERIM(dupeHand)/100);

MakeTag;

END;

END;

END;

END;

Run(Space);

Link to comment

I object. The credits should mention Charles Chandler and Paul. Besides, the original code is ? someone at NNA... I may have cannibalized & transmogrified it beyond recognition, but that does not make it excusable for me not to have acknowledged the original author. Shame on me!

Link to comment

Still trying to recover from the multitude of surprises today...

If someone actually wants to use the ancient Space object by various authors, including yours truly, please at least get rid of anything related to font & text size and include

SETOBJECTVARIABLEBOOLEAN(objHand, 800, TRUE);

in the script to enable standard font definition.

Link to comment

No, I think it's yours, Petri. As I recall (it's been a long time, but...) you wanted us to open-source ours, so you could tweak some things, and we couldn't do that, so you did your own and put it on VectorDepot. There may have been some example code on the VS list, but what I see above is a lot more than example code. So I think it's yours.

Link to comment

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