Ilogics rules to modified parts Z offset in Assembly

Ilogics rules to modified parts Z offset in Assembly

Anonymous
Not applicable
321 Views
3 Replies
Message 1 of 4

Ilogics rules to modified parts Z offset in Assembly

Anonymous
Not applicable

Hi All,

 

I Have a bundle of pipes, which I places in a assembly, with only Z offset 25 mm by using Iproperties, Now I want to change all pipes Z offset to 30 mm, I create a costume parameters to change the value but this not effect if I change the parameters.  If there a method or a Ilogic rule to do it? looking forward to hear  from you.

 

RG

 

0 Likes
322 Views
3 Replies
Replies (3)
Message 2 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Please provide sample assembly with pipe to investigate and make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi Chandra,

 

Thanks you for answering.

Actually this are the same pipes you are helping with ilogic earlier this month. This time I want make an ilogic rule in IAM. 

Please see attached. this example 12 pipes layer 2 I want to change the Z offset.

 

RG 

0 Likes
Message 4 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous ,

 

Try below iLogic code to change position in Z offset.

Sub Main()
    
    Dim oDoc As AssemblyDocument
    oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As AssemblyComponentDefinition
    oDef = oDoc.ComponentDefinition
    
    Dim occ As ComponentOccurrence
    occ = oDef.Occurrences.Item(2)
    
    Dim trans As Matrix
    trans = occ.Transformation
    
    trans.Cell(3, 4) = 3.5 'Z offset in cm 
    occ.Transformation = trans
    
    Call oDoc.Update
End Sub

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes