Jump to content
Developer Wiki and Function Reference Links ×

Unable to place 2D pio in 3D.


Recommended Posts

I am unable to create and 3Drotate a 2D PIO in the same script.

Procedure NewPIORect;

VAR
PIORect 			: handle;
OK				: boolean;

BEGIN
PIORect :=createcustomobjectN('PIORect', 0,0,0,FALSE);
{setrot3D(PIORect ,90,0,0,0,0,0);}
OK := SetEntityMatrix(PIORect ,0,0,0,90,0,0);
END;
run(NewPIORect);

I tried booth the SetEntityMatrix function and the setrot3D.

If I try to rotate it later with another script, it works fine

ex:

{setrot3D(LSactlayer,90,0,0,0,0,0);}
message(SetEntityMatrix(LSactlayer,0,0,0,90,0,0));

Is this another bug, or am I doing something wrong?

PS: -This is just an example. My PIO is complex and I really need to insert and rotate it from another script. I cannot insert it directly

-I need the control points in 3D, that is why I need a 2D PIO and not A 3D PIO with 2D objects in it.

Thanks

Link to comment

I think you're answering your own question -- you are rotating the 3D component of the PIO, which is empty. You can have the 2D instance in the screen plane or layer plane and have it draw in a 3D view, but you would need to orient it with a 2D rotation. You can do that right with CreateCustomObjectN.

-Josh

Link to comment

You can't have a 2D object in a 3D plane (a 2D PIO or any kind of 2D object).

2D objects show up in 3D views in the following ways:

- In the layer plane (xy)

- In the screen plane

If you want to manipulate control points in a 3D view, say on the XZ plane, you have to align your screen plane to the XZ plane (ie front view).

Alternatively, you can create a viewport of your 3D view, which will essentially project the view onto the 2D plane, and you can lay your PIO on top.

If you're just trying to rotate the PIO as a workaround for control points being 2D only, as far as I know, this is not possible.

-Josh

Link to comment

Well, in the script above, I use SetEntityMatrix

VS:SetEntityMatrix

Description :

Sets the matrix of the plane for a planar object. If there is already a plane in the document with that matrix, the object will be set to be in that plane. Otherwise a new plane will be added to the document.

FUNCTION SetEntityMatrix(
            objectHandle     :HANDLE;
            offsetX          :REAL;
            offsetY          :REAL;
            offsetZ          :REAL;
            rotationXAngle   :REAL;
            rotationYAngle   :REAL;
            rotationZAngle   :REAL) : BOOLEAN;

This function was made to place a planar object on a 3D plane. And it works fine EXCEPT in my case where I create AND MOVE the object (POI) in the SAME script.

Does anyone know how to do it?

Link to comment

The weird think is that it works fine except during the script of creation of the PIO.

It tried but it doesn't rotate because hybrid object are forbidden to rotate in 3D.

It tried a 3D only PIO and it does not rotate.

I tried setting a working plane by script.

It really seems like it is impossible to create and rotate in a PIO from the same script...

Link to comment

The PIO code is indeed run after the SetEntityMatrix function.

Here is what i think happens :

For more efficiency, the pio codes are run at the end and once only.

This has 2 consequences :

- Resetobject has not effect.

- VW does not know what kind of PIO it is dealing with (3D only, hybrid or 2D only) in doubt the developers block the 3D rotations.

this is something new, I just tried in VW2010 and it works fine for 3D only PIO...

Well if someone can help me finding a works around, I would really appreciate it.

Thanks,

Link to comment

You can execute different code in the same pio by sending messages. The workflow can be something like the following:

1. Check messages. if no message (0) then do function 1.

2. Change messages to do function 2 if needed and reset object

3. Check messages, if message (1), do function 2.

4. Change messages back to no message (0).

But more importantly, I am lost as to what are you trying to do. Place a 2D pio on a 3D plane? Pio's behave similar to symbols and for hybrids, the normal way is to place them on the top 2D view so that when you change to a 3D view, the 3D objects will be shown. The pio will execute both the 2D & 3D object creation in the same reset event but will only show the 2D objects on the top plan view and the 3D objects on all other views.

We might be able to help further if we knew what the pio is suppose to do.

Link to comment

Sorry, but I don't understand at all what you mean with the messages.

My pio is a kind of 3D (vertical) associate dimension. It's position and place are depending of other of my PIO's. I need the PIO to be 2D because I need the control points to be available in a vertical plane. (to change the shape of the dimension)

I use a other tool to create the PIO and define on which objects the "associate dimension PIO" must be locked.

Vectorscript seem to be unable to create and move on a vertical plane the 2D PIO in the same script. (my insertion tool)

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