My situation is I need to copy the instance property from one schematic to another one. For example, I have schematic_source and schematic_target. The instances in schematic_target is a subset of schematic_source.
For example, schematic_source has C0-C99. schematic_target has C0-C9. I need to copy the width and length property from source to targer for C0-C9.
It seems that I am encounting an issue that I cannot select the schematic I want: The ddsServOpen command automatically select the new opened schematic. So, when I first open the source and target schematics, the selected schematic is the one that is opened latter. And when I loop through C0-C9, there is no way for me to tell the tool to select the source schematic and query the property there.
Below is my pseudo code:
ddsServOpen(schematic_source )
ddsServOpen(schematic_target )
source_cvId = dbOpenCellViewByType( schematic_source )
target_cvId = dbOpenCellViewByType( schematic_target )
instances_target= target_cvId->instances;
foreach( instance instances_target
instance_name=instance~>name
printf("instance name is: %s\n",instance_name)
refObj_source = rodGetObj( instance_name source_cvId)
instance_dbId_source = refObj_source~>dbId
;get the values {w,l,connection,segments} FROM source
geDeselectAll()
geSelectObject( instance_dbId_source )
schHiObjectProperty()
w=schObjPropForm->w->value;
printf("w=%s \n",w)
l=schObjPropForm->l->value;
printf("l=%s \n",l)
hiFormDone(schObjPropForm)
geDeselectAll()
; put the values {w,l,connection,segments} TO target
refObj_target = rodGetObj( instance_name target_cvId)
instance_dbId_target = refObj_target~>dbId
geDeselectAll()
geSelectObject( instance_dbId_target )
schHiObjectProperty()
schObjPropForm->w->value=w
schObjPropForm->l->value=l
hiFormDone(schObjPropForm)
geDeselectAll()
);end foreach
It seems that when the first schHiObjectProperty() is executed. The tools has the target schematic selected. So, although the instance in the source schematic is selected as I can see it, the "q" button is applied on the target schematic, and therefore, will not pop up the property window of the instance from the source schematic, and therefore, the w and l is nil in the first place.
The non-elegant solution is probably is probably I open and close the schematic on the fly, each time having only one opened schematic. But I fear that it creates too much overhead in opening and closing. I wonder whether is a more timing efficient to tell the tool that I want to select one of the two windows that are open, by name or ID.