Jump to content
Developer Wiki and Function Reference Links ×

Combined PIO


Recommended Posts

Is it possible to use the "edit path"-mode from a slavePIO inside a MasterPIO ?

I've got a 2d path object I want to be on 2 layers at once (one object), where each part on each layer can be changed with the edit path mode. Can I call this for a sub-PIO ? maybe trough a button/script on the MasterPIO ?

Link to comment

I don't exactly understand what you mean.

What you can certainly NOT do is a PIO on 2 layers at once.

What you could do is having a slave PIO that is on another layer than his master PIO and that set its position from the master's.

When the master moves, on the other hand, it could reset the slave PIO. This last one is therefore always placed from the master's location...

I hope this helps. If it does, I can explain more.

Link to comment

I've got a custom space PIO that does about the same stuff as the original, but better and has some more options I need.

Because of all the calculations we have to do, I need to find out the position and INNER and OUTER area of each room. At this point, I have to draw this object 2 times for each room, which won't change when I manage to get them connected, but at least the data on the space object can be shared easily.

It would be nice if I could draw the outer one first, click a button on the object to add another path within it and change it to fit the inner one. 2 area's in one PIO. Where I can always choose which path I want to edit

I've added a picture to show what i'm trying to achieve.

Also, it isn't an option to set a wallthickness so the script can calculate the inner area, since every wall can have a variable thickness.

Edited by hippothamus
Link to comment

I've added a picture to show what i'm trying to achieve.

You could use one pio for what you are trying to achieve. It will make it easier internally:

- On path can be the 'real' path of your space plug-in and be in the path container, the other can be in the profile container of the plug-in.

- Or you can force to have one path with a hole in it and then extract the two paths in your plug-in as normal paths. This way, the user can modify the two paths at the same time through the path container.

- There may be other solutions.

Link to comment

You could use one pio for what you are trying to achieve. It will make it easier internally:

- On path can be the 'real' path of your space plug-in and be in the path container, the other can be in the profile container of the plug-in.

I've tried something but I can't make it work. The path gets copied as a polyline into the profile, both can be edited but I can't make the profile visible on the drawing. The path dances a bit around while going out of edit mode, but looks correct eventually.

PolyHd := CreateDuplicateObject(pathHd, objHd);
profileHd :=GetCustomObjectProfileGroup(objHd);
IF profileHd=NIL THEN BEGIN
    alrtdialog('profiel aanmaken');
    profileHd := CreateDuplicateObject(PolyHd, objHd);
    temp_b:=SetCustomObjectProfileGroup(objHd,profileHd);
    IF temp_b THEN AlrtDialog('profiel geplaatst');
END;
profileHd := CreateDuplicateObject(profileHd, objHd);

- Or you can force to have one path with a hole in it and then extract the two paths in your plug-in as normal paths. This way, the user can modify the two paths at the same time through the path container.

So if I add a standard polygon or smth in the profile, I could substract with CreateExtrudeAlongPath one time, to create this path with a hole in it.

But would I be able to get the perimeter and area of the inner and outer part of this one path ?

- There may be other solutions.

I wouldn't know :P

Edited by hippothamus
Link to comment

At this point, I have to draw this object 2 times for each room, which won't change when I manage to get them connected, but at least the data on the space object can be shared easily.

If it is about sharing data, then the easiest way might be to just share data.

Let me explain :

You can give a name to your Master object.


if  getname(objhd)='' then
  setname(objHd,CreateUUID);

and store the master name in one of the slave PIO parameters.

then you can get all you need in the slave PIO directly from the master.


MasterHd := GetObject(PMasterName);
AnyParam:=GetRField(MasterHd,GetName(GetRecord(MasterHd,1)),'AnyParam'); 

On the other hand, you can store the Slave's name in the Master PIO so it can access the slave's info (Path area for instance)

Link to comment
  • 1 year later...

hi hippothamus,

I don't know if you still need it. Are you working with a 2d path PIO? then you can use the 'Add/Intersect/Clip Surface' event. You enable it with

kObjXIs2DSurfaceEligible = 14;

result := SetObjPropVS(kObjXIs2DSurfaceEligible, TRUE);

see this example

http://www.vectorlab.info/index.php?title=Events#Example_7

I used it for a floor plate PIO with openings in it, it works fine.

You draw the path of the floor and then you subtract the openings...

Link to comment
hi hippothamus,

I don't know if you still need it. Are you working with a 2d path PIO? then you can use the 'Add/Intersect/Clip Surface' event. You enable it with

kObjXIs2DSurfaceEligible = 14;

result := SetObjPropVS(kObjXIs2DSurfaceEligible, TRUE);

see this example

http://www.vectorlab.info/index.php?title=Events#Example_7

I used it for a floor plate PIO with openings in it, it works fine.

You draw the path of the floor and then you subtract the openings...

Not anymore no but still thanks for the hint :)

Working with the sdk now

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