michaelk Posted October 5, 2021 Share Posted October 5, 2021 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? Quote Link to comment
Julian Carr Posted October 5, 2021 Share Posted October 5, 2021 Try this: SymbolToGroup(h1, 2); hGroup := NextObj(h1); Quote Link to comment
michaelk Posted October 5, 2021 Author Share Posted October 5, 2021 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); Quote Link to comment
Julian Carr Posted October 5, 2021 Share Posted October 5, 2021 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? Quote Link to comment
michaelk Posted October 5, 2021 Author Share Posted October 5, 2021 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. Quote Link to comment
Julian Carr Posted October 5, 2021 Share Posted October 5, 2021 FWIW, I always use Set3DRot() Quote Link to comment
Julian Carr Posted October 5, 2021 Share Posted October 5, 2021 Maybe it only works in PIOs, which is where I am using it? Quote Link to comment
michaelk Posted October 5, 2021 Author Share Posted October 5, 2021 Could it be because the symbol is hybrid? How would I strip it down or extract the 3D from the symbol definition? Quote Link to comment
Julian Carr Posted October 5, 2021 Share Posted October 5, 2021 Assuming this is just a script not a PIO, this should work: VSave('XYZ'); DoMenuTextByName('Standard Views', 2); { top} Explode; VRecall('XYZ'); VDelete('XYZ'); Also, the following will be true for a 3D object (mostly): GetObjectVariableBoolean(h1, 650); Quote Link to comment
michaelk Posted October 5, 2021 Author Share Posted October 5, 2021 It's a script until I figure it out. Then I want it to be a PIO. Tell me more about Explode. My function reference doesn't have an Explode function. Is that Australian only? 🙂 Quote Link to comment
Julian Carr Posted October 5, 2021 Share Posted October 5, 2021 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. 1 Quote Link to comment
MullinRJ Posted October 7, 2021 Share Posted October 7, 2021 @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 Quote Link to comment
Recommended Posts
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.