The easiest way to move the Pin objects when moving the corresponding Component object is to select the Pin objects together with the Component object. You can either do this manually by selecting all the objects when you want to move them or you can do this e.g. via a Script which, when executed, selects the Pin objects connected via INTERREF with the selected Component object.
Regarding the Script:
1) Create an attribute of type “EXPRESSION” with the name e.g. “PinsInterrefIDs” for the class Component
2) Add the following Expression to the standard value of the PinsInterrefIDs attribute:
EXPR type:string expr: (irtobjs("#Name of the INTERREF attribute which connects the Pins with the Component object#")) → e.g. EXPR type:string expr: (irtobjs("Pins"))
3) AdoScript code: What the following script basically does is
a) it gets all the IDs of selected objects in an active model
b) it loops through the list with the IDs and because only the selected Component objects are relevant in this case it checks for the objects of class Component
c) For the selected Component objects it gets the IDs of the Pins objects, which are connected via INTERREF with a selected Component object, into an array
d) it loops through the array to select all the Pins objects
1CC "Modeling" GET_ACT_MODEL
2# --> RESULT modelid:intValue
3SETL nModelID:(modelid)
4
5CC "Modeling" GET_SELECTED modelid:(nModelID)
6# --> RESULT ecode:intValue objids:strValue classid:id
7SETL sSelectedObjects:(objids)
8
9#Create an array for the Pins objects IDs
10SETL aPinsObjects:({})
11
12FOR i from:(0) to:(tokcnt(sSelectedObjects)-1) {
13
14 #check for the selected objects of Class Component in case
15 #there are more objects of different classes selected at once
16 CC "Core" GET_CLASS_ID objid:(VAL (token(sSelectedObjects,i)))
17 #--> RESULT ecode:intValue classid:intValue isrel:intValue
18 CC "Core" GET_CLASS_NAME classid:(classid)
19 #--> RESULT ecode:intValue classname:strValue isrel:intValue
20
21 #in case a selected object is of class Component then get
22 #the IDs of the connected (via INTERREF) Pin objects and put them
23 #into the array aPinsObjects
24 IF (classname = "Component") {
25 CC "Core" GET_ATTR_VAL objid:(VAL (token(sSelectedObjects,i))) attrname:("PinsInterrefIDs")
26 #-->RESULT ecode:intValue val:anyValue
27 FOR j in:(val) {
28 SETL dummy:(aappend(aPinsObjects, VAL j))
29 }
30 }
31}
32
33#select all the Pins objects belonging to selected Component objects
34FOR i from:(0) to:(aPinsObjects.length - 1) {
35 CC "Modeling" SELECT objid:(aPinsObjects[i])
36 # --> RESULT ecode:intValue .
37}