how to change size of a custum content center file with ilogic in a form

how to change size of a custum content center file with ilogic in a form

Davey_van_den_Berg
Contributor Contributor
1,316 Views
4 Replies
Message 1 of 5

how to change size of a custum content center file with ilogic in a form

Davey_van_den_Berg
Contributor
Contributor

Hello guys,

 

I'm searching for a way to change the flange with a form in combination with ilogic.

but i dont know how to make a code that can adjust de flange with the "change size" command.

i also did't find it on the forum. if somebody know how to help me i would be thankful!

 

thanks in advance,

Davey 

0 Likes
1,317 Views
4 Replies
Replies (4)
Message 2 of 5

Mark.Lancaster
Consultant
Consultant

@Davey_van_den_Berg

 

Granted I don't know what your process is but that functions is already there.  Right mouse click on flange and change size..  Smiley Very Happy

 

Programming question should be asked in the Inventor Customization forum.  I will have the moderator relocate your posting there to better suit your needs.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 3 of 5

Davey_van_den_Berg
Contributor
Contributor

thanks for your reply.

 

i know it can be done like that but that is the manual way and i am looking for a way to do it within ilogic.

0 Likes
Message 4 of 5

HermJan.Otterman
Advisor
Advisor

 

In the Api help in Inventor you will find this example....

 

 

Replace content center part

Replace content center part API Sample

Description

This sample demonstrates how to replace the content part referenced by an assembly occurrence.

Code Samples

Open an assembly that contains an occurrence of a content part and run the macro.
Sub ReplaceContentCenterPart()
    ' Set a reference to the active assembly document.
    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.ActiveDocument

    ' Prompt user to pick an occurrence
    Dim oOcc As ComponentOccurrence
    Set oOcc = ThisApplication.CommandManager.Pick(kAssemblyOccurrenceFilter, "Pick occurrence to replace")

    If oOcc.DefinitionDocumentType <> kPartDocumentObject Then
        MsgBox "Occurrence does not reference a content part."
        Exit Sub
    End If

    Dim oOccDef As PartComponentDefinition
    Set oOccDef = oOcc.Definition

    If Not oOccDef.IsContentMember Then
        MsgBox "The occurrence does not reference a content part."
        Exit Sub
    End If

    ' Set a reference to the ContentCenter object.
    Dim oContentCenter As ContentCenter
    Set oContentCenter = ThisApplication.ContentCenter

    ' Get the content node (category) "Fasteners:Bolts:Hex Head"
    Dim oContentNode As ContentTreeViewNode
    Set oContentNode = oContentCenter.TreeViewTopNode.ChildNodes.Item("Fasteners").ChildNodes.Item("Bolts").ChildNodes.Item("Hex Head")

    ' Get the "ISO 4015" Family object.
    Dim oFamily As ContentFamily
    For Each oFamily In oContentNode.Families
        If oFamily.DisplayName = "ISO 4015" Then
            Exit For
        End If
    Next

    ' Create a member based on the second row of the family.
    Dim error As MemberManagerErrorsEnum
    Dim strContentPartFileName As String
    Dim strErrorMessage As String
    strContentPartFileName = oFamily.CreateMember(2, error, strErrorMessage)

    Call oOcc.Replace(strContentPartFileName, False)
End Sub
If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 5 of 5

Anonymous
Not applicable
I see your replies in the forum and just scroll away from them. I dont know why you keep commenting on questions that you dont know the answer of.