- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I'm looking for code to simply loft 2 profiles along a centreline. I have multiple to do and looking to speed the process.
I assumed I need to define my profiles, centreline then define a loft. Hence, the code below:
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oP1 As Profile, oP2 As Profile
oP1 = oDoc.ComponentDefinition.Sketches("Section1").Profiles.AddForSolid
oP2 = oDoc.ComponentDefinition.Sketches("Section2").Profiles.AddForSolid
Dim oP3 As LoftDefinition.Centerline
oP3 = oDoc.ComponentDefinition.Sketches("Path1").
Dim oCol As ObjectCollection
oCol = ThisApplication.TransientObjects.CreateObjectCollection
oCol.Add oP1
oCol.Add oP2
Dim oLoftDef As LoftDefinition
oLoftDef = oDoc.ComponentDefinition.Features.LoftFeatures.CreateLoftDefinition(oCol, kJoinOperation)
Dim oLoftF As LoftFeature
oLoftF = oDoc.ComponentDefinition.Features.LoftFeatures.Add(oLoftDef)
However, this doesn't work and errors out. How do it get the centreline to be added in?
Solved! Go to Solution.