turn off adaptivity using ilogic. leave reference

turn off adaptivity using ilogic. leave reference

jskim00
Advocate Advocate
446 Views
2 Replies
Message 1 of 3

turn off adaptivity using ilogic. leave reference

jskim00
Advocate
Advocate

hello
I am using the below code to clear all adaptability of the assembly.

I want to know how to use it without clearing the reference as shown in the picture

   

 

 

Dim doc As Document = ThisApplication.ActiveDocument

 

For Each oDoc As Document In doc.AllReferencedDocuments

        Try

               If oDoc.ModelingSettings.AdaptivelyUsedInAssembly = True Then

                       oDoc.ModelingSettings.AdaptivelyUsedInAssembly = False

               End If

        Catch

        End Try

Next

 

 

0 Likes
Accepted solutions (1)
447 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor
Accepted solution

Hi @jskim00.  Would this iLogic code work OK for you?  I have not tested it yet myself, because I did not have any assembly examples (I can test on) with any adaptive components in them.

Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oOccs As ComponentOccurrences = oADef.Occurrences
Dim oOcc As ComponentOccurrence ' = oOccs.ItemByName("Part3:1")
For Each oOcc In oOccs
	If oOcc.Adaptive Then
		Try
			oOcc.Adaptive = False
		Catch
			Logger.Debug("Could not turn 'Adaptive' off for component named '" & oOcc.Name & "'.")
		End Try
	End If
Next

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3

jskim00
Advocate
Advocate

Thank you! it works very well!

0 Likes