Jump to content
Developer Wiki and Function Reference Links ×

Handle to symboltogroup.


michaelk

Recommended Posts

I'm trying to do a 3D rotation (Set3DRot or SetRot3D) on a group that was created by using SymbolToGroup(h,2);

 

I can't figure out a way to get the handle to that group.  

 

LNewObj doesn't do it.

 

I've tried BeginGroupN(hGroup); and running the SymbolToGroup inside that group so I could get a handle, but that doesn't work.

 

Tried a Waldo.  No luck.

 

Any thoughts?

Link to comment

Nope.  looking at Debugger.  groupHandle never gets assigned.

 

PROCEDURE TEST;

VAR
    h,groupHandle
                        : HANDLE;
BEGIN


Symbol('Test Symbol',0,0,0);

h := LNewObj;

SetView(#-90d,#0d,#0d,0",0",0");

SymbolToGroup(h,2);

groupHandle := NextObj(h);

SetRot3D(groupHandle,#90d,#0d,#0d,0,0,0);


END;

RUN(TEST);

Link to comment

It works in my code as does this:

 

            BeginGroup;
                Symbol(GetSymName(hSym), x1, y1, GetSymRot(hSym));
                SymbolToGroup(LNewObj, 2);
            EndGroup;
            hGroup := LNewObj;

 

But does SetRot3D() support groups? 

Link to comment

I've been trying both SetRot3D and Set3DRot (because I can't remember which is which and it feels faster to try both than look it up and retain it :-).

 

Procedure Set3DRot rotates the referenced 3D object about a specified 3D point. It works with the following 3D objects: extrude, multiple extrude, sweep, mesh, 3D polygon, solid, CSG solid, group, symbol, plug-in object, NURBS curve, NURBS surface.

Link to comment

Explode = SymbolToGroup() = STG. If it will be a PIO and you want to rotate a symbol in the Z axis, then it must not be hybrid. You will need to investigate a way to restore the view after you switch it to 3D for the STG. Alternatively if the symbols don't contain groups or nested symbols, then you could get a handle to the symbol definition, enter the definition, loop through and duplicate 3D objects then use SetParent() to move them to the PIO, all within BeginGroup/EndGroup, then rotate the group.

  • Like 1
Link to comment

@michaelk

   Why not place your symbol, rotate it in 3D (or set its 3D angles), THEN convert it to a group? If it is a Hybrid Symbol, you will be limited to Z-axis rotations only. If it is a Hybrid Symbol and you want XY-axis rotations, duplicate the symbol definition, remove all 2D parts, then place the new symbol, rotate, and "explode". Delete the duplicate if desired.

 

Raymond

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