How do you use gePointToFig to select multiple nets

M

Martin

Guest
Hi,

I'd like to use the gePointToFig to select multiple nets from a
schematic and add their names to a field on a form. At the moment I
have to keep pressing the "select on Schematic" button on the form
I've created and select them one by one. I'd like to press a button
once, click on a number of nets in a schematic and then hit the ESC
key.

Cheers
Martin
 
Hi Martin,

You may find the following example helpful. You might need to fine
tune it for your application.
;
procedure(RKselectNets()
enterPoints(
?prompts '("Select the first net ..."
"Select the next net ...")
?doneProc "RKselectNetsdoneProc"
)
)
;
procedure(RKselectNetsdoneProc(window _done points)
let( (figure netName (netNames nil))
foreach( point points
figure = gePointToFig(window nil point)
;; only for figures with nets, i.e. not instance terms
when(figure && figure~>objType=="line" && figure~>net
netName = figure~>net~>name
printf("Selected net: %s.\n" netName)
netNames=cons(netName netNames)
)
)
)
)
;

Execute RKselectNets() in your CIW and then click you nets. End your
selection by Escape.
When the enterpoints get to end signal, it executes the ?doneProc
callback, i.e the RKselectNetsdoneProc function.
You may need to add few lines into this function in order to interact
wit your form.

Hope this help !
Regards,
Riad.
 
On 14 Apr, 23:23, Riad KACED <riad.ka...@gmail.com> wrote:
Hi Martin,

You may find the following example helpful. You might need to fine
tune it for your application.
;
procedure(RKselectNets()
enterPoints(
?prompts '("Select the first net ..."
"Select the next net ...")
?doneProc "RKselectNetsdoneProc"
)
)
;
procedure(RKselectNetsdoneProc(window _done points)
let( (figure netName (netNames nil))
foreach( point points
figure = gePointToFig(window nil point)
;; only for figures with nets, i.e. not instance terms
when(figure && figure~>objType=="line" && figure~>net
netName = figure~>net~>name
printf("Selected net: %s.\n" netName)
netNames=cons(netName netNames)
)
)
)
)
;

Execute RKselectNets() in your CIW and then click you nets. End your
selection by Escape.
When the enterpoints get to end signal, it executes the ?doneProc
callback, i.e the RKselectNetsdoneProc function.
You may need to add few lines into this function in order to interact
wit your form.

Hope this help !
Regards,
Riad.
Thanks Riad, works great.
It was the enterPoints function that I was missing.

Cheers
Martin
 

Welcome to EDABoard.com

Sponsor

Back
Top