Jump to content
LarryO

VW 3D Steel shapes, rotation, ungrouping impossible

Recommended Posts

Posted (edited)

Does anyone understand why it has to be so difficult to work the 3D steel shapes in VW?

 

They all start as point objects extruded along the positive z-axis. I've tried to rotate the Wide Flange - 3D with all three rotation procedures

Set3DRot ; SetRot3D ; Rotate3D (edit: and HRotate) and all I can accomplish is rotation about the z-axis.

I went so far as to attempt to ungroup to see if I could rotate the extrude but neither ungrouping procedure HUngroup nor Ungroup works with this object. They both deselected the Wide Flange beam regardless of selecting Yes in the latter.

Edited by LarryO

Share this post


Link to post

Hi Larry,

   It sounds like you are trying to work with a Hybrid PIO, one that contains 2D and 3D parts. They can only be rotated around the Z-axis. That said. I just placed a "Wide Flange-3D" object in a blank drawing and was able to rotated it manually in all 3 axes, and I wrote a one line script to rotate it 90° around the X-Axis. It executed successfully. I then ungrouped the object in the drawing which yielded an extrude of the flange shape.

 

   Based on your description it sounds like we are talking about two different objects. Can you post a small file with the object in it and a fragment of your script that is causing problems? I'm sure Pat Stanford will answer your question before I get back to it.   : p   (You go Pat)  Oh, I was using VW 2019 when I tried the above. Please specify the VW version you are using, too. 

 

Thanks,

Raymond

Share this post


Link to post
Posted (edited)

thanks Julian, that is definitely a DOH! Homer moment for me.

 

I've tried this in both a tool and linear object testing the bracketed lines one by one, VW2019

 

BeamHandle:=CreateCustomObjectN('Wide Flange - 3D',0,0,0,FALSE);
SetRField(BeamHandle,'Wide Flange - 3D','__series_2', 'AISC (Metric)');
SetRField(BeamHandle,'Wide Flange - 3D','__size_2', 'W200 x 22.3');
SetRField(BeamHandle,'Wide Flange - 3D','Length', '3000mm');
SetRField(BeamHandle,'Wide Flange - 3D','__current_series', '2');
SetRField(BeamHandle,'Wide Flange - 3D','__current_size_2', 'W200 x 22.3');

 

{Rotate3D(0,45,0);}
{HRotate(BeamHandle,0,45,0);}
{Set3DRot(BeamHandle,0,45,0,0,0,0);}
{SetRot3D(BeamHandle,0,45,0,0,0,0);}


{Locus(0,0);
SetSelect(LNewObj);
SetSelect(BeamHandle);
SetView(-90,0,0,0,0,0);
DoMenuTextByName('Rotate Right 90',0);}

Edited by LarryO

Share this post


Link to post

This works for me:

 

Procedure T;
VAR
    BeamHandle : HANDLE;
BEGIN
    BeamHandle:=CreateCustomObjectN('Wide Flange - 3D',0,0,0,FALSE);
    SetRField(BeamHandle,'Wide Flange - 3D','__series_2', 'AISC (Metric)');
    SetRField(BeamHandle,'Wide Flange - 3D','__size_2', 'W200 x 22.3');
    SetRField(BeamHandle,'Wide Flange - 3D','Length', '3000mm');
    SetRField(BeamHandle,'Wide Flange - 3D','__current_series', '2');
    SetRField(BeamHandle,'Wide Flange - 3D','__current_size_2', 'W200 x 22.3');
    Set3DRot(BeamHandle,0,45,0,0,0);
    ResetObject(BeamHandle);
END;
Run(T);

  • Like 1

Share this post


Link to post

Thanks, Julian.

   I got back in just as you posted your last answer. Nicely done. This is a great forum. Gotta love it.

 

Thanks,

Raymond

Share this post


Link to post

Thanks, I'm still 😕

 

Adjusting for the missing zero Set3DRot(BeamHandle,0,45,0,0,0,0); I pasted in your text exactly.

I tried it in a tool, a point, a linear and a palette script. All four produced a steel column at 0,0,0 rising perpendicular to x/y plane along the z-axis, not rotated 45° from vertical as was anticipated.

 

Note that it does rotate about the z-axis, which is the location where I placed the missing zero value, in bold.

So this responds Set3DRot(BeamHandle,0,0,45,0,0,0); but changing the value for the x or the y axis is doing nothing.

I just don't get it. 

I don't really want to do my own beam oriented extrusions and lose the ability to pull data off their Wide Flange object. Oh well.

Share this post


Link to post
Posted (edited)

You know I think that part of this puzzle lies in this description.

 

Quote

The difference between Set3DRot and SetRot3D is that Set3DRot adds the specified rotation to the existing rotation of the object, whereas SetRot3D does not consider the existing rotation, and merely makes the object rotation match the specified values.

 

There being no X or Y rotation values to be replaced in a point object's format could be the underlying problem here.

Edited by LarryO
typo

Share this post


Link to post

Larry,

   Try this:

 

Procedure T;
VAR
    BeamHandle :HANDLE;
BEGIN
    BeamHandle := CreateCustomObjectN('Wide Flange - 3D', 0, 0, 0, FALSE);
    SetRField(BeamHandle,'Wide Flange - 3D','__series_2', 'AISC (Metric)');
    SetRField(BeamHandle,'Wide Flange - 3D','__size_2', 'W200 x 22.3');
    SetRField(BeamHandle,'Wide Flange - 3D','Length', '3000mm');
    SetRField(BeamHandle,'Wide Flange - 3D','__current_series', '2');
    SetRField(BeamHandle,'Wide Flange - 3D','__current_size_2', 'W200 x 22.3');


    SetRot3D(LSActLayer, 0, 45, 0,   0, 0, 0);


END;
Run(T);

 

   I modified Julian's code a little. The BeamHandle variable is used to build the object. After it's built, you can reference it from the viewpoint of the drawing and get a handle to it as it sits on the design layer. If at first you don't succeed, start changing things.

 

HTH,

Raymond

 

 

 


 

Share this post


Link to post
Posted (edited)

Hmmm, it does do a rotation but I'm fairly certain it's rotating the parent PIO and not the beam inside.

Every time the PIO is reset it rotates to a new position, like when one changes the parent PIO's length either in the OIP or with the control point.

 

I've never thought of a PIO being hybrid object like a symbol? Am I'm wrongly creating this 3D object in its 2D environment?

EDIT: I don't think so.

I'm leaning towards my earlier hypothesis that the 3D Rotation functions are looking to replace values in X and Y rotation parameters that don't exist or buggy pointers.

Edited by LarryO
additional thoughts

Share this post


Link to post

Hi Larry,

   It's not buggy, it's just semantically picky.   VERY PICKY.    It's the nature of all programming languages. They do exactly what you say, and not what you think you said.

 

   In this case you probably want to rotate the flange about its insertion point, and not the User Origin. I wasn't thinking about how you wanted to use it, just that it could be rotated.

 

   For my next guess ...

Try this at the end of the sample script:

 

    GetSymLoc(LSActLayer, x, y, z);                 { get the insertion point of the PIO }
    SetRot3D(LSActLayer, 0, 45, 0,   x, y, z);    { rotate about the PIO's insertion point }
 

DISCLAIMER : I don't know exactly how you are applying your code, so this may not work out of the box. Some assembly may be required. Don't try this at home, unless you are self-isolating. If I guessed wrong, please write back. I got a million of 'em. 😉

 

Again, HTH,

Raymond

 

  • Like 1

Share this post


Link to post

The first goal after getting this Wide Flange laid down in a beam position in plan view is to be able to draw in one like we do lines. Drawing them out in linear fashion point to point. Springing up out of the ground plane as these steel shapes do they easily serves as columns or posts, but not so as beams and rails.

Share this post


Link to post

Well guys, Julian , Ray,

The fun continues.

I was unable to convert an instance of a Wide Flange - 3D PIO to a group with SymbolToGroup() inside a linear PIO.

(I ungrouped my linear parent PIO after it had finished and found the WF-3D PIO still existed.)

 

I was also unable to rotate a 3D symbol about the Y-axis inside a linear PIO. I placed the Wide Flange - 3D inside a symbol, thinking that if I could rotate a symbol instance I could convert the symbol back to a group and ungroup that I could get the steel shape orientated in the direction of the control point.

 

I am 100% sure that using LSActLayer is currently capturing a handle to the parent PIO and not the WF-3D PIO inside, which may rotate something other than the parent PIO once there a more objects in the layer. LNewObj does return the same WF-3D handle as the create custom object function.

 

It's beginning to appear that the approach to tackling this little monster is to extract and import the beam data and create my own beam extrusion where the axial rotations can be set. Let's hope it is still possible to rotate or draw a polyline onto the y-z plane for extruding in the x direction. 🙂

Share this post


Link to post

I think you are correct about getting the wrong handle. If the WF is inside the PIO, then it is not on the layer and the LSActLayer will certainly not get you the correct object.

 

Do a search on the forum for the Waldo method. Basically put a locus, GetParent(LNewObject) to know where you are, and then find your object inside that parent.

 

You are just on the steep part of the learning curve. What you want can be done.

 

I recommend starting with simpler objects (maybe just extrudes, or even a two point 3D Poly) to figure out how to get the rotations to work. Then you can do back and change the object types.

Share this post


Link to post

Thanks Pat,

I was making sure I fully explored Raymond's suggestions to see if I could find a work around.

I have not had any issue yet getting the handle to the Wide Flange - 3D object. The issue has been getting one of the rotation functions to rotate it about the y-axis while it is inside the linear PIO that I've been writing this script for. Or converting devolving it from the Wide Flange - 3D object to the basic extrude for rotation. Failed on that front too. SymbolToGroup and Ungroup don't work on it either inside the linear PIO.

I'm beginning to think that it is the linear PIO environment that is interfering the 3D operations. I tried to rotate a 3D symbol instead of the PIO last night and got nothing on the x or y-axis rotations, only on the z-axis. So I will probably have to write my own steel extrusion routine, because lengthening the extrusion in a linear fashion is the way to go with this. The current tool is too clumsy to create 3D structural assemblies. 

Share this post


Link to post

If I were you I would go back to the absolute simplest version and make sure I know how to make the rotation tools work.


Forget about the PIO for now. Just make a couple of extrusions on a design layer and make sure you can rotate them relative to each other the way you need. Once you figure that out, then you can move into trying in a group or symbol or PIO.

 

I am pretty sure it is not a problem with the linear PIO.  The only thing the PIO does is gives you the automatic control over a single length parameter that you can use in your script.

 

PIOs do have a different coordinate space than the drawing with everything coming from the 0,0,0 insertion point of the PIO. You can't use global coordinates to move things inside the PIO.

Share this post


Link to post

Thanks Pat, I know you are with 99% probability correct.

Today with a pre-defined 3D symbol that didn't contain the WF-3D PIO I was easily able to rotate it into the correct position.

The concept of the environments inside and outside the PIO I have fairly down pat now. I created a stair and railing design tool about four years ago with the linear PIO template. I had that thing doing the flip and rotate dance all over the screen until I sorted out the relationship between an insertion point in the world origin and a PIO's internal origin.

I may have to explore or rule out the possibility of a definition timing issue. When writing out a script for creating pickets in an inclined guardrail I had to separate it into a tool part and a linear object part. I simply couldn't capture the first set of control points inside the linear PIO. They had to be captured before creating the PIO using a creation tool. Aside from the WF-3D PIO, the original 3D symbol I attempted to rotate was defined inside the linear PIO. The PIO also places the instance which might not be created before the script attempts to rotated the instance. I forgot to put in a reset/regen. More testing required.

Thanks guys for all the input.

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.


 

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