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: 

Swept Surface Face IDs Differ between code and manual generated versions

0 REPLIES 0
Reply
Message 1 of 1
R.Mabery
280 Views, 0 Replies

Swept Surface Face IDs Differ between code and manual generated versions

I'm seeing behaviour that I believe is odd.  

 

Manual create sweep:

If I manually create a surface sweep using two sketches, the face IDs are in 'sequential order' meaning from one end to the other, they are items 1,2,3,4.

 

Using code to create sweep:

If I used code to create the sweep using the same sketch and features, the face IDs are not in 'sequential order'.

 

Below is an image calling out the sketch line IDs at the top and the surface face IDs at the bottom after built with code.

 

swept_surfaces.jpg

 

Below is the code that creates the sweep:

Dim oSketchColl as ObjectCollection
oSketchColl = ThisApplication.TransientObjects.CreateObjectCollection

For j = 1 to iSketchLineCount
	oSketchColl.Add(oImportedSketch.SketchLines.Item(j))
Next j 

Dim oSweepLine as SketchEntitiesEnumerator 
oSweepLine = oImportedSketch.OffsetSketchEntitiesUsingDistance(oSketchColl, dOD, False, False, True)

Dim oSweepPath as Path
oSweepPath = oCompDef.Features.CreatePath(oSweepLine.Item(1))

Dim oSweepProfile as Profile
oSweepProfile = oSketches.Item("Sketch_1_Start").Profiles.AddForSurface(oSketches.Item("Sketch_1_Start").SketchArcs.Item(1))

Dim oSweepDef as SweepDefinition
oSweepDef = oCompDef.Features.SweepFeatures.CreateSweepDefinition(kPathSweepType, oSweepProfile, oSweepPath, kSurfaceOperation)

Dim oSweep As SweepFeature
oSweep = oCompDef.Features.SweepFeatures.Add(oSweepDef)

 

It's important that I keep the face IDs consistent as I'm addressing those faces later on.

 

 


Thanks,
Randy Mabery
Applications Expert
IMAGINiT Technologies
0 REPLIES 0

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report