Jump to content
Sign in to follow this  
AdrianHedley

PIO ExtrudeAlongPath Reset On Attribute Change

Recommended Posts

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);

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

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.

Sign in to follow this  

 

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