David O Posted July 30, 2019 Share Posted July 30, 2019 Hello VS folks ! Sometime ago i implemented a tool (vst) that applied a path extrusion using some profile libraries for a customer... Using: createcustomobjectpath('Extrude Along Path', hNURBsPath, hperfil); And the result is perfect ! However, we found a weird behavior happening when we try to use this tool in a layer with an elevation different then zero. When i try to use the tool in any layer with elevation different then zero, the resulted path extrusion follows a completely different path. Trying to fix this behavior i tried to use SetLayerElevation(ActLayer, 0.00, 0.00); Before the call to createcustomobjectpath('Extrude Along Path', hNURBsPath, hperfil); It fixes the problem ... however, only if i leave the elevation of the layer at 0.00 If i try to call SetLayerElevation() to restablish the original elevation (after the call to createcustomobjectpath()) the result is an incorrect path again... Any ideas ? Quote Link to comment
Pat Stanford Posted July 30, 2019 Share Posted July 30, 2019 What do you mean by the profile object takes an entirely different path? Can you show us images? Can you post a small test file with copies of the extrudes on layers with different elevations? It will be much easier and better to try and troubleshoot your objects than to try and create an object that duplicates the problem. Quote Link to comment
JBenghiat Posted July 31, 2019 Share Posted July 31, 2019 How are you getting hNURBsPath? If you are drawing as a 2D path or using a 2D profile group, this may help: SetPlanarRefIDToGround(hPoly); hNURBsPath:=ConvertToNURBS(hPoly, TRUE); Quote Link to comment
David O Posted August 1, 2019 Author Share Posted August 1, 2019 Follows attach a .vst which has just a part of the function i use in my plug-in to apply the Path Extrude I'm attaching also a .vwx that shows the behavior mentioned... To reproduce: After loading the vst in there interface... - Open the document, execute the tool and draw a path on the top of the extruded polygon ... The tool applied profile in a path extrude modeled without problems... Delete the path extrude model - Change the layer to "Level 1" (which is 300cm above Level 0) Execute the tool again... and draw the path again using the same reference points over the extruded polygon See the result Border Aplication TEST File.vwx Aplic Perfis TST.vst Quote Link to comment
David O Posted August 1, 2019 Author Share Posted August 1, 2019 Answering 6 hours ago, JBenghiat said: How are you getting hNURBsPath? If you are drawing as a 2D path or using a 2D profile group, this may help: SetPlanarRefIDToGround(hPoly); hNURBsPath:=ConvertToNURBS(hPoly, TRUE); I'm using CallTool (-313) to call 3D Polygon to draw the path ... inside the tool. And it works perfectly ... except of the fact it displace things when the layer has an elevation as mentioned ... Tsk Quote Link to comment
Miguel Barrera Posted August 1, 2019 Share Posted August 1, 2019 Make sure that the profile object is a group as in: BeginGroup; profileObjects EndGroup; profileHdl:= LNewObj; I have not come up with the offset elevation problem because I do keep the insertion point at 0 elevation for all PIOs. However, I do have to place the PIO at the same elevation as the terrain model. Rather than change the layer elevation , I move the entire object to the desired elevation as in: PROCEDURE SetElev(objHdl: HANDLE; org3Dz,elev: REAL); VAR dz: REAL; BEGIN dz:= elev - org3Dz; IF dz <> 0 THEN BEGIN Move3DObj(objHdl,0,0,dz); ResetObject(objHdl); END; END; I did have a problem at one time with the change in elevation not showing so I had to add the ResetObject to fix it. 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.