<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Ilogic Extrusion from Derived Part in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-extrusion-from-derived-part/m-p/7949966#M83554</link>
    <description>&lt;P&gt;I'm trying to create an extruded cut 'through all' from a sketch that I have included from a derived part however the sketch is not recognised as a profile when calling the extrude feature in iLogic. All my search results thus far have been referencing extrusions in standard parts but I imagine that my problem would be very common to skeletal modelling when coupled with iLogic...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my model with the code in question&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies in advance for some potentially horrendous code, I'm still very much a beginner and at the copy from forum to ilogic rule stage and repeat as required &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'Prompt for user form
'iLogicForm.Show("Create Wedge Type Sideliner")

'set a reference to the setup sideliner component definintion.
'this assumes a part document is open.
Dim oPartCompDef As PartComponentDefinition
oPartCompDef = ThisApplication.ActiveDocument.ComponentDefinition

'define the path and file name
Dim sPathandName As String
sPathandName  = ThisDoc.PathAndFileName(False)

' Create a new part file to derive the selected part into 
'note: kPartDocumentObject is the default template
'you could specify a path and file name for a custom template
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject)) 


'create the derived setup sideliner part definition

Dim oDerivedPartDef As DerivedPartDefinition 
oDerivedPartDef = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.CreateDefinition(sPathandName &amp;amp; ".ipt")

'Set derive style options

oDerivedPartDef.DeriveStyle = DerivedComponentStyleEnum.kDeriveAsSingleBodyWithSeams
'options:
	'kDeriveAsSingleBodyWithSeams 
	'kDeriveAsSingleBodyNoSeams 
	'kDeriveAsMultipleBodies 
	'kDeriveAsWorkSurface 

'Create the derived part
Dim oDerivedPart As DerivedPartComponent 
'MsgBox(sPathandName)
oDerivedPart = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Add(oDerivedPartDef)

Dim oDerivedPartComp As DerivedPartComponent
oDerivedPartComp = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents(1)

Dim oDerivedPartDef_2 As DerivedPartUniformScaleDef
oDerivedPartDef_2 = oDerivedPartComp.Definition

Dim oDerEntity As DerivedPartEntity
Dim oProfile As Profile
For Each oDerEntity In oDerivedPartDef_2.Sketches
If (oDerEntity.ReferencedEntity.Name = "final_sideliner_height_mod") Then
oDerEntity.IncludeEntity = True
'MsgBox("found it")
Exit For
End If
Next

Dim oSketch As DerivedPartEntity
oSketch = oDerivedPartDef_2.Sketches("final_sideliner_height_mod")


'***THIS {PART HERE IS NOT WORKING FOR DERIVED PART SKETCH AS PROFILE LOOP IN THE EXTRUSION BELOW
'oProfile = oSketch.AddForSolid


'Set Definition back, so DerivedPart Document is updated
oDerivedPartComp.Definition = oDerivedPartDef_2

Dim oPartCompDef_2 As PartComponentDefinition
oPartCompDef_2 = ThisApplication.ActiveDocument.ComponentDefinition

'Modify the Derived Setup Sideliner into the Final Geometry
'Step 1 - Adjust the height:

' Create an extrusion 
Dim oExtrude As ExtrudeFeature
oExtrude = oPartCompDef_2.Features.ExtrudeFeatures.AddByDistanceExtent(oSketch,1000,kSymmetric,kCutOperation)

iLogicVb.UpdateWhenDone = True&lt;/PRE&gt;</description>
    <pubDate>Sat, 21 Apr 2018 16:55:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-04-21T16:55:25Z</dc:date>
    <item>
      <title>Ilogic Extrusion from Derived Part</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-extrusion-from-derived-part/m-p/7949966#M83554</link>
      <description>&lt;P&gt;I'm trying to create an extruded cut 'through all' from a sketch that I have included from a derived part however the sketch is not recognised as a profile when calling the extrude feature in iLogic. All my search results thus far have been referencing extrusions in standard parts but I imagine that my problem would be very common to skeletal modelling when coupled with iLogic...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my model with the code in question&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies in advance for some potentially horrendous code, I'm still very much a beginner and at the copy from forum to ilogic rule stage and repeat as required &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B4D44A73814D7FC0D950DEDFACB97081/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;'Prompt for user form
'iLogicForm.Show("Create Wedge Type Sideliner")

'set a reference to the setup sideliner component definintion.
'this assumes a part document is open.
Dim oPartCompDef As PartComponentDefinition
oPartCompDef = ThisApplication.ActiveDocument.ComponentDefinition

'define the path and file name
Dim sPathandName As String
sPathandName  = ThisDoc.PathAndFileName(False)

' Create a new part file to derive the selected part into 
'note: kPartDocumentObject is the default template
'you could specify a path and file name for a custom template
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject)) 


'create the derived setup sideliner part definition

Dim oDerivedPartDef As DerivedPartDefinition 
oDerivedPartDef = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.CreateDefinition(sPathandName &amp;amp; ".ipt")

'Set derive style options

oDerivedPartDef.DeriveStyle = DerivedComponentStyleEnum.kDeriveAsSingleBodyWithSeams
'options:
	'kDeriveAsSingleBodyWithSeams 
	'kDeriveAsSingleBodyNoSeams 
	'kDeriveAsMultipleBodies 
	'kDeriveAsWorkSurface 

'Create the derived part
Dim oDerivedPart As DerivedPartComponent 
'MsgBox(sPathandName)
oDerivedPart = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Add(oDerivedPartDef)

Dim oDerivedPartComp As DerivedPartComponent
oDerivedPartComp = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents(1)

Dim oDerivedPartDef_2 As DerivedPartUniformScaleDef
oDerivedPartDef_2 = oDerivedPartComp.Definition

Dim oDerEntity As DerivedPartEntity
Dim oProfile As Profile
For Each oDerEntity In oDerivedPartDef_2.Sketches
If (oDerEntity.ReferencedEntity.Name = "final_sideliner_height_mod") Then
oDerEntity.IncludeEntity = True
'MsgBox("found it")
Exit For
End If
Next

Dim oSketch As DerivedPartEntity
oSketch = oDerivedPartDef_2.Sketches("final_sideliner_height_mod")


'***THIS {PART HERE IS NOT WORKING FOR DERIVED PART SKETCH AS PROFILE LOOP IN THE EXTRUSION BELOW
'oProfile = oSketch.AddForSolid


'Set Definition back, so DerivedPart Document is updated
oDerivedPartComp.Definition = oDerivedPartDef_2

Dim oPartCompDef_2 As PartComponentDefinition
oPartCompDef_2 = ThisApplication.ActiveDocument.ComponentDefinition

'Modify the Derived Setup Sideliner into the Final Geometry
'Step 1 - Adjust the height:

' Create an extrusion 
Dim oExtrude As ExtrudeFeature
oExtrude = oPartCompDef_2.Features.ExtrudeFeatures.AddByDistanceExtent(oSketch,1000,kSymmetric,kCutOperation)

iLogicVb.UpdateWhenDone = True&lt;/PRE&gt;</description>
      <pubDate>Sat, 21 Apr 2018 16:55:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-extrusion-from-derived-part/m-p/7949966#M83554</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-21T16:55:25Z</dc:date>
    </item>
  </channel>
</rss>

