2 Replies Latest reply on Nov 13, 2018 2:33 PM by Justin Holder

    Lofted Boss/Base via VBA macro

    Justin Holder

      I'm new to the forum and have tried more times than I can count to figure out my problem. So far I can perform the outlined below process by using the GUI for creating a rotor blade and section of the hub wheel. The steps are

       

      1) Insert Curve by XYZ points: I have 21 3D closed section curves which are essentially 3D airfoils (e.g., secCrv1.sldcrv through secCrv21.sldcrv) which show as Curve1 through Curve21 in the Feature Tree.

      2) I then create fill-surfaces for the first and last section curves (Curve1 and Curve21, respectively)

      3) There are then 24 additional 3D curves that serve as guide curves that I insert by XYZ points found in *.sldcrv files which create Curve22 through Curve45

      4) I select Lofted Boss/Base. The profiles are, in order: Surface-Fill1, Curve2 through Curve20, and Surface-Fill2. The guide curves are Curve22 through Curve45

      5) The created loft generates a rotor blade

      6) A similar process creates the hub wheel

       

      So far I've figured out how to do all of the above steps through a macro EXCEPT creating the loft. I've attempted using CreateLoftBody2 as well as InsertProtrusionBlend2 with no success. I'm hoping to replicate the exact process I do in the GUI within a macro. Can anyone shed some light on what I'm doing wrong? Note that I'm currently using version 2016. Also, attached is my macro (also shown below). I appreciate any and all advice as I'm at my wits end trying to figure this out.Thanks!!!

       

      ***EDIT***

       

      When I run the below macro (with the lines regarding lofting commented out) I then get a "skeletal" shape of my geometry as shown in pic 1. There are many curves and 4 surfaces (non-planar). The surfaces serve as profiles to loft between.

      Pic 1:

      SWscriptCurrent.PNG

       

      With the script completed, I then have to manually select "Lofted Boss/Base" within the GUI (this is the part I'd like to incorporate into the macro). The loft preview is shown in pic 2.

      Pic 2:

      SWloftSelections.PNG

       

      After accepting the loft, the completed blade is shown in pic 3.

      Pic 3:

      SWloftBlade.PNG

       

      With the blade loft completed, several similar steps are performed to complete the section of the rotor hub disk. These operations include a "Lofted Boss/Base" (similar to above) to complete the the rotor hub disk, an "Extruded Cut" of a cylinder along the rotation axis (e.g., a circle is drawn on the "Right Plane," and the extruded cut is "Through All - Both"), and lastly a fillet is added to the blade root. Pic 4 shows the completed geometry.

      Pic 4:

      SWfinal.PNG