Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inventor API VBA 3D Loft with Rails

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
819 Views, 4 Replies

Inventor API VBA 3D Loft with Rails

I am writing a code that grabs points from an excel to create two closed 3d sketches defined by splines and then loft between them. I also want to be able to create rails between all the corresponding points. 

 

My first question is how to change the fit method of a spline with api VBA? Creating a 3D spline using the SketchSplines3D command defaults to minimum energy, but I'd rather use standard or autocad curve fitting.

 

My second question is about the rails. I want the program to be able to use a different number of points each time if required. I can create all my sketches for the top and bottom surfaces and can create the sketches for the rails all using loops but I cannot add the rails to the loft definition using LoftDefinition.LoftRails.Add Profile within the loop and if I put it outside the loop that creates the rail sketch lines only the last line is added to the loft feature as a rail. How can I create a different number of rails each time the program is run and have them all added to the loft feature?

 

Thanks for any help.

4 REPLIES 4
Message 2 of 5
LukeDavenport
in reply to: Anonymous

Hi acurtin,

You will need a separate 3D sketch for each rail I believe.
Luke
Message 3 of 5
Anonymous
in reply to: LukeDavenport

How can I do that if the number of sketches can vary each time the program is run?
Message 4 of 5
Anonymous
in reply to: LukeDavenport

After some more work I was able to use your suggestion and get the rails to work.

Any idea on the curve fit method? Standard Fit is set as the default in my application settings and is used when manually creating a spline but when I make a spline with code it defaults to minimum energy.
Message 5 of 5
LukeDavenport
in reply to: Anonymous

I haven't looked at your description properly, but it should just be the
setting in the BSplineDefinition called FitMethod that you want. The 3
settings are below:

BSplineDef.FitMethod = SplineFitMethodEnum.kSmoothSplineFit
BSplineDef.FitMethod = SplineFitMethodEnum.kSweetSplineFit
BSplineDef.FitMethod = SplineFitMethodEnum.kACADSplineFit

Cheers
Luke

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

Post to forums  

Autodesk Design & Make Report