Derived part material and stock number

Derived part material and stock number

jcloutierMQ36F
Observer Observer
407 Views
5 Replies
Message 1 of 6

Derived part material and stock number

jcloutierMQ36F
Observer
Observer

Hi,

is there a way to simply get material and stock number information in derived part from the base component?

0 Likes
408 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor

Hi @jcloutierMQ36F.  This can be a very confusing topic to ask questions about, so using correct terms/words and being as clear as possible is important.  I just want to make sure what the phrase "in derived part from the base component" means.

Scenario 1:  If you have a Part document open on your screen right now (the active document), and some 'other' part is derived into this active document, then are you wanting to be able to get the material and stock number from that 'other' part (the one that is derived into this part)?

Scenario 2:  If you have a Part document open on your screen right now (the active document), and this document is derived into some 'other' Part document, and you want to be able to get the material and stock number from the other Part document that this Part document is derived into?

 

Scenario 1 may be possible, but Scenario 2 would normally not be possible, but may be possible to achieve in certain special situations.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 6

jcloutierMQ36F
Observer
Observer

The scenario 1 is exactly the case I wanted to explain, sorry for confusion.

I am wanting to get material, stock number and maby other innformation that are not parameters from derived part and use them into the active part.

In this specific case, I derived a part created by the frame generator into a new one that I want to modify. It works properly but I want the material and stock number to be updated if changes are done in the frame.

0 Likes
Message 4 of 6

WCrihfield
Mentor
Mentor

OK.  Since you want these things to stay updated when the original model changes, I do not believe this would be possible.  I may be able to access those things within the document that is being derived into this part, and I may be able to 'copy' their 'static' values into the active document, but I do not know of any way to include those things as part of the 'derive in' process/definition, so that they would stay 'linked'.  There is currently no built-in way to include iProperties or Material in the Derive Part definition.  When the original part was designed as sheet metal, and the part it is being derived into was also created as sheet metal, then there is an option to "Link Sheet Metal Styles", but I am not familiar enough with that setting to know if that will cause the very specific behavior of [if only the Material in original changes, that will automatically change only the material in the part that it is derived into].

WCrihfield_0-1712842903269.png 

WCrihfield_1-1712843020274.png 

WCrihfield_2-1712843037602.png

Here is some iLogic rule code you can play around with which shows hot to access a lot of those types of settings, just for future reference.

Sub Main
	Dim oPDoc As PartDocument = TryCast(ThisDoc.Document, Inventor.PartDocument)
	If oPDoc Is Nothing Then Return
	Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
	'check to see if there are any Parts (DerivedPartComponents) derived into this document
	Dim oDPCs As DerivedPartComponents = oPDef.ReferenceComponents.DerivedPartComponents
	If oDPCs.Count = 0 Then
		Logger.Info("No DerivedPartComponents found in this PartDocument.")
		Return
	End If
	'<<< access the settings of the existing 'Derive Part' >>>
	'get just the first one (it is possible to have more than one)
	Dim oDPC As DerivedPartComponent = oDPCs.Item(1)
	'Log some of its direct settings
	Logger.Info("DerivedPartComponent HealthStatus = " & oDPC.HealthStatus.ToString)
	Logger.Info("DerivedPartComponent IsEmbedded = " & oDPC.IsEmbedded)
	Logger.Info("DerivedPartComponent LinkedToFile = " & oDPC.LinkedToFile)
	Logger.Info("DerivedPartComponent Name = " & oDPC.Name)
	Logger.Info("DerivedPartComponent SuppressLinkToFile = " & oDPC.SuppressLinkToFile)
	'get its 'Definition'
	Dim oDPDef As DerivedPartDefinition = oDPC.Definition
	'Log some of the Definition direct settings
	Logger.Info("Derive Style = " & oDPDef.DeriveStyle.ToString)
	Logger.Info("ActiveDesignViewRepresentation = " & oDPDef.ActiveDesignViewRepresentation)
	Logger.Info("IsAssociativeDesignView = " & oDPDef.IsAssociativeDesignView)
	Logger.Info("ActiveModelState = " & oDPDef.ActiveModelState)
	Logger.Info("LinkFaceColorFromSource = " & oDPDef.LinkFaceColorFromSource)
	Try : Logger.Info("LinkSheetMetalStyles = " & oDPDef.LinkSheetMetalStyles) : Catch : End Try
	Logger.Info("LinkSketchFormattingFromSource = " & oDPDef.LinkSketchFormattingFromSource)
	Logger.Info("ReducedMemoryMode = " & oDPDef.ReducedMemoryMode)
	Logger.Info("UseOrientedMinimumBoundingBox = " & oDPDef.UseOrientedMinimumBoundingBox)
	'find out which more specific type of DerivedPartDefinition this is, to access more specific stuff
	If TypeOf oDPDef Is DerivedPartCoordinateSystemDef Then
		Dim oDPCSDef As DerivedPartCoordinateSystemDef = oDPDef
		'access to more specific stuff

	ElseIf TypeOf oDPDef Is DerivedPartTransformDef Then
		Dim oDPTDef As DerivedPartTransformDef = oDPDef
		'access to more specific stuff
		
	ElseIf TypeOf oDPDef Is DerivedPartUniformScaleDef Then
		Dim oDPUSDef As DerivedPartUniformScaleDef = oDPDef
		'access to more specific stuff
		Logger.Info("ScaleFactor = " & oDPUSDef.ScaleFactor)
		
	End If
	'access the actual Document & File of the part derived into this document
	Dim sFDN As String = oDPC.ReferencedDocumentDescriptor.FullDocumentName
	Logger.Info("Derived-In FullDocumentName = " & sFDN)
	Dim oDerivedInPartFile As Inventor.File = oDPC.ReferencedDocumentDescriptor.ReferencedFileDescriptor.ReferencedFile
	Dim oDerivedInPartDoc As PartDocument = oDPC.ReferencedDocumentDescriptor.ReferencedDocument
End Sub

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 5 of 6

jorgen.bjornes
Collaborator
Collaborator

I'm revisiting this topic. I believe after Inventor 2025.1 we should be able to edit settings like DerivedPartDefinition.LinkSheetMetalStyles. I would thing inserting something like "oDPDef.LinkSheetMetalStyles=True" in the code @WCrihfield provided would be able to set the property, but I cannot seem to make it do anything..

 

Am I misunderstanding this newly added functionality?

Ref https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=DerivedPartDefinition_LinkSheetMetalStyles

0 Likes
Message 6 of 6

bradeneuropeArthur
Mentor
Mentor

Please than vote this

 

https://forums.autodesk.com/t5/inventor-ideas/derived-part-and-assembly-copy-i-properties/idi-p/6349...

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes