rodCreatePath pts conditional (if/then)

R

Rick Mattern

Guest
is it possible to create a rodPath with conditional pts? If so, what
is the correct syntax?

for( i 0 pVdrainCnt
pOutRx = pOutRx + pOutRxstep
;; place a via at x,y
rodCreatePath( ?cvId cv
?layer list(metal1Layer "drawing")
?width outConnWidth

?pts list( if( f_n_a > 1 then
pOutRx:0.315 + w_p_b_int_Micro pOutRx:0

else

pOutRx:0.315 + w_p_b_int_Micro + 0.5 pOutRx:0)))
); for

Thanks

Rick
 
On Sep 15, 5:55 pm, Rick Mattern <ejm2...@gmail.com> wrote:
is it possible to create a rodPath with conditional pts?   If so, what
is the correct syntax?

for( i 0 pVdrainCnt
  pOutRx = pOutRx + pOutRxstep
  ;; place a via at x,y
       rodCreatePath( ?cvId cv
        ?layer  list(metal1Layer "drawing")
        ?width   outConnWidth

                 ?pts list( if( f_n_a > 1 then
                        pOutRx:0.315 + w_p_b_int_Micro  pOutRx:0

                        else

                        pOutRx:0.315 + w_p_b_int_Micro + 0.5  pOutRx:0)))
   ); for

Thanks

Rick
Hi,

Probable you want somethimg like
//~~~~~~~~~~~~~~~~~~~~~~~~
for( i 0 pVdrainCnt
pOutRx = pOutRx + pOutRxstep
;; place a via at x,y
rodCreatePath( ?cvId cv
?layer list(metal1Layer "drawing")
?width outConnWidth

?pts if( f_n_a > 1 then
list(pOutRx:0.315 + w_p_b_int_Micro
pOutRx:0)
else
list(pOutRx:0.315 + w_p_b_int_Micro + 0.5
pOutRx:0))
) ; if
); for
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But, I personnaly will put the if/else just before rodCreatePath()
call, into a local var.
The code is more readable.

BR,
Marcel
 
On Sep 16, 3:19 am, Marcel Preda <marcel.pr...@gmail.com> wrote:
On Sep 15, 5:55 pm, Rick Mattern <ejm2...@gmail.com> wrote:



is it possible to create a rodPath with conditional pts?   If so, what
is the correct syntax?

for( i 0 pVdrainCnt
  pOutRx = pOutRx + pOutRxstep
  ;; place a via at x,y
       rodCreatePath( ?cvId cv
        ?layer  list(metal1Layer "drawing")
        ?width   outConnWidth

                 ?pts list( if( f_n_a > 1 then
                        pOutRx:0.315 + w_p_b_int_Micro  pOutRx:0

                        else

                        pOutRx:0.315 + w_p_b_int_Micro + 0.5  pOutRx:0)))
   ); for

Thanks

Rick

Hi,

Probable you want somethimg like
//~~~~~~~~~~~~~~~~~~~~~~~~
for( i 0 pVdrainCnt
  pOutRx = pOutRx + pOutRxstep
  ;; place a via at x,y
       rodCreatePath( ?cvId cv
        ?layer  list(metal1Layer "drawing")
        ?width   outConnWidth

                 ?pts if( f_n_a > 1 then
                            list(pOutRx:0.315 + w_p_b_int_Micro
pOutRx:0)
                        else
                            list(pOutRx:0.315 + w_p_b_int_Micro + 0.5
pOutRx:0))
                        ) ; if
   ); for
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But, I personnaly will put the if/else just before rodCreatePath()
call, into a local var.
The code is more readable.

BR,
Marcel
Thanks for the reply. The reason to have it nested is to change the
pts at a certain trip point.
However, it seems to change the behavior of the for loop.

Rick
 
Rick Mattern wrote, on 09/16/10 17:53:
Thanks for the reply. The reason to have it nested is to change the
pts at a certain trip point.
However, it seems to change the behavior of the for loop.

Rick
What do you mean by it changing the behaviour of the for loop? I can't see how
that would happen. If that's a problem for you still, you might want to elaborate.

The problem (that Marcel fixed) was that the if() was only returning the second
coordinate, and so the list passed to ?pts only had a single point in it. Since
you needed the if() to return a list of points, it was necessary to put the
list() inside the then/else parts of the if() call.

Regards,

Andrew.
 

Welcome to EDABoard.com

Sponsor

Back
Top