AdrianHedley Posted October 26, 2010 Share Posted October 26, 2010 I created a PIO using an arc as path, converted to nurbs curve and used an oval for profile shape. Original arc created in horizontal 2d plane then when converted to nurbs rotated vertical (I want the option to rotate as desired). Then created an extrude along path object from rotated nurbs curve and oval profile. Works okay .... until I select object and change properties in attribute dialog then PIO resets so that it changes orientation relative to the current viewing angle. Can anybody help? This does not happen with other PIO's say made from sweep objects. PIO code is as follows; PROCEDURE Test1; VAR objname :STRING; result :BOOLEAN; oh,rh,wh :HANDLE; h1, h2, h3 :HANDLE; BEGIN result:= GetCustomObjectInfo(objname,oh,rh,wh); IF result THEN BEGIN ArcByCenter(9", 9", 9", 180, 90); h1:=LNewObj; h1:=ConvertToNURBS(h1,false); Set3DRot(h1, 90, 0, 0,0, 0, 0); Oval(-3 5/16", 3 5/16", 3 5/16", -3 5/16"); h2:=LNewObj; h3:=CreateExtrudeAlongPath(h1, h2); END; END; RUN(Test1); Quote Link to comment
Vectorworks, Inc Employee klinzey Posted October 26, 2010 Vectorworks, Inc Employee Share Posted October 26, 2010 ConvertToNURBS is a view dependent operation. The simplest way around this is to check the view. If you are not in a top or top plan view then save the view, switch to a top view, do the work then switch the view back. Quote Link to comment
Assembly Posted October 26, 2010 Share Posted October 26, 2010 GetView(xAngleR,yAngleR,zAngleR,offsetX, offsetY, offsetZ); SetView(xAngleR,yAngleR,zAngleR,offsetX, offsetY, offsetZ); I've had a couple PIO's where this method has caused critical failure in my PIO's before. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted October 26, 2010 Vectorworks, Inc Employee Share Posted October 26, 2010 Yes, this works as designed. It works the same way as if you were to run the Convert To NURBS menu command. There are times when you want to work with the object in the current view or a view other than top. There are a few things you can do to speed things up. Check the view first. If xAngleR,yAngleR,zAngleR are all 0 then don't change the view. You should also check the the projection GetProjection() in case you are working in rotated plan. IF (Projection <> 6) & ((xAngleR<> 0) | (yAngleR<> 0) | (zAngleR<> 0)) THEN SetView() You can also use SetPref(9873,TRUE) to prevent a screen redraw when the view is changed but then you MUST call SetPref(9873,FALSE) after you set the view back. You will see the largest speed increase in a 3D view from this. In 2011 there are some other methods using the planer ref that may work depending on what you are trying to accomplish. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted October 26, 2010 Vectorworks, Inc Employee Share Posted October 26, 2010 I know a few of the machine design objects work based off a front view. And menu commands often work based on the active view so the object is created in the same orientation as the original. Quote Link to comment
Pat Stanford Posted October 26, 2010 Share Posted October 26, 2010 Kevin, Would moving the view so the objects are off screen, doing the operation and then moving the view back help in the speed. I think I used this a long time ago and found that the drawing of the selection handles was the biggest slow down and that having them off screen meant they didn't have to be drawn and was much faster. Quote Link to comment
Dieter @ DWorks Posted October 27, 2010 Share Posted October 27, 2010 Why using ConvertToNurbs? Use CreateNurbsCurve and add the control points, this way you can work view independant. It may feel wierd because you won't do this by hand, but it's better in scripts. Use AddVertex3D to add points to the nurbs curve. 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.