Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sweep Geometry with NWCreate API

9 REPLIES 9
Reply
Message 1 of 10
SENO1285
908 Views, 9 Replies

Sweep Geometry with NWCreate API

Greetings,

 

I have developed a loader using the NWCreate API, but now I'm stuck.

As input I have polygon contours (profiles), which I need to extrude or rotate to make solids in NavisWorks.

 

Input for translational sweeps: Sweep length, sweep direction(vector), coefficients of sweep plane, polygon contour

Output: Polygon contour is extruded in space to form a solid.

 

Input for rotational sweeps: Sweep axis, sweep rotation angle, coefficients of sweep plane, polygon contour

Output: Polygon contour is rotated in space to form a solid

 

How can I accomplish this using the NWCreate API?

9 REPLIES 9
Message 2 of 10
xiaodong_liang
in reply to: SENO1285

Hi,

 

some comments from our engineer team:

 

two options.

 

  1. Just do it yourself. For a translational sweep, you can just construct polygons for the edges of the sweep. For rotational sweeps, you can use the Conic function to create the curved surfaces. This would be probably the most reliable method.
  2. You could use the B-Rep functions to create a Prism or a Revolve. You would construct a Face that represents the profile to sweep, then pass it to one of the two functions. The B-Rep APIs may be a bit harder to use. I would probably recommend the first option unless the profiles are very complicated. But if they are planar with linear edges, then it should be straightforward. If the profiles they want to extrude have curved edges, and the want to revolve it, the it’s a bit harder. The B-Rep API might be a better option.

 

Hope this helps.

 

Message 3 of 10
gfarmer1
in reply to: xiaodong_liang

I saw elsewhere in the Autodesk forums (http://forums.autodesk.com/t5/Navisworks-General-Discussion/nwcreate-and-BRep-objects/td-p/2706251) that the B-Rep modeling functionality is not available with the stand-alone version of NWCreate.  This post if from 2009, though.  Is this still the case?

Message 4 of 10
xiaodong_liang
in reply to: gfarmer1

Hi,

yes, the current version has still no API for B-Rep. Sorry if this a bad news for you.
Message 5 of 10
gfarmer1
in reply to: xiaodong_liang

I am attempting to extrude a b-spline over a specific distance to create the side of a component. I have successfully created the b-spline, but when I attempt to extrude it with the following, I cannot set the extrusion distance - Navisworks defaults to 20 meters.  What am I missing?

 

LcNwcExtrudedSurface Surface(curve, new LtVector{ 0,0,1 }); //20 meters - can't fight
LcNwcFace face(Surface, LI_NWC_SENSE_NEGATIVE);
LcNwcShell shell;
shell.AddFace(face);

Nwstream.BRepShell(shell)

 

Message 6 of 10
xiaodong_liang
in reply to: gfarmer1

Hi,
could you share a sample project that can demo this issue? I can test at my side to diagnose. Thank you.
Message 7 of 10
gfarmer1
in reply to: xiaodong_liang

Xiaodong -

 

A sample project is attached.  The b-spline projection starts on line 60 of BSplineLoader.cpp.  Thank you for your help.

 

Gordon

Message 8 of 10
gfarmer1
in reply to: xiaodong_liang

Xiaodong -

I should have mentioned: this sample project results in a file loader that takes .bsp files (I made up the file extension). Just create a text file and give it a .bsp extension and use that - this sample project doesn't really read the .bsp file at all.

Please let me know if you have any questions.

Gordon
Message 9 of 10
xiaodong_liang
in reply to: gfarmer1

Hi Gordon,

 

I failed to build your project, but I also consulted with our engineer in the mean time. He shared a quick comment:

 

The problem here is that they are creating just a surface. In this case, an “extruded surface” is a semi-infinite surface that needs to be bounded before it can be correctly rendered.

 

It sounds like what they want to do is use the Prism function instead, LiNwcBRepCreatePrism, which takes an entity (either a loop or a face), and extrudes it in a given direction for a specified distance.

 

I think maybe these comments can help you already. 

 

I will also find time to make your project working at my side. I believe I simply missed something.

Message 10 of 10
gfarmer1
in reply to: xiaodong_liang

Xiaodong -

 

That makes sense.  I am able to create a B-Spline Curve (LcNwcBSplineCurve).  Can you briefly explain how I can get from a Curve to a Loop or a Face?  I can't figure it out from the documentation and I don't see any examples in the API that demonstrate this.

 

Thank you.

 

Gordon

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report