Jump to content
Sign in to follow this  
paulvector2

Hole in path Pio

Recommended Posts

I made a path Pio similar to builtin space tool. Sofar it works fine. But if i want to cut out an hole in my spacepoly with the 2Dreshape tool nothing happens. Any ideas?

Share this post


Link to post

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

Share this post


Link to post

No worries, mate!

As far as I know, it only needs to be pasted into a script; certain parts of course must be deleted (eg "RUN"). Beyond this, I can't help because I can't actually make it work! It should, but does not.

Share this post


Link to post

Dear Petri,

i modified your space PIO, posted in Vectordepot, "event-enabled", which works fine now. if you want i can post the code here.

Share this post


Link to post

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);

Share this post


Link to post

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!

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

Sorry, Charles: I just modified an NNA example. It was, I think, some sort of electrical wiring thing. Without the sample, I could never have been able to figure out how to write path objects.

Share this post


Link to post

paul,

what version does that script run under?

i get a pile of "Identifier not declared"

errors...

Share this post


Link to post
*** You are ignoring this user ***

Fascinating. Mr. Scott is a truly deep thinker.

Share this post


Link to post

petri

i am actually staggeringly shallow,

i always find it's never wise to

hold myself out to be any kind of

expert or thinker in the murky

waters of the web...

best wishes, kisses kisses,

gideon scott

Share this post


Link to post

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.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...