How to write a CSV file after getting all connector coordinates and linked comps id.
How to write a CSV file after getting all connector coordinates and linked comps id.
I have written following code:
*createmark connectors 1 all
set ce_list [ hm_getmark connectors 1];
foreach CE_L $ce_list {
set coordi [hm_ce_getcords $CE_L]
set LKD [hm_ce_getlinkentities $CE_L comps]
puts $coordi
puts $LKD
puts 'The coordinates of connector is $coordi and its linked components are $LKD'
}
Now, I have to write a CSV file, so that I can call all those in different profiles
Answers
-
Hi Jouher,
Your code should look something like below:
set str_wrfilename {c:\test.csv};
set f_id [open $str_wrfilename w+]*createmark connectors 1 all
set ce_list [ hm_getmark connectors 1];
foreach CE_L $ce_list {
set coordi [hm_ce_getcords $CE_L]
set LKD [hm_ce_getlinkentities $CE_L comps]
puts $f_id '[set coordi],[set LKD]'
}
close $f_id0