Home > Community > Forums > PCB SKILL > Moving an object with axlTransformObject

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Moving an object with axlTransformObject 

Last post Thu, Apr 6 2006 8:18 AM by archive. 4 replies.
Started by archive 06 Apr 2006 08:18 AM. Topic has 4 replies and 1951 views
Page 1 of 1 (5 items)
Sort Posts:
  • Thu, Apr 6 2006 8:18 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    Moving an object with axlTransformObject Reply

    Hello,

    I am having trouble getting data into the axlTransformObject command.

    I am using concat to join the x value, a comma, and the y value, and then insert the result into the transform object line, but it's separating the first number with \'s. I guess this means there is something I don't know about concat.


    when i run the program printf prints:

    compLoc (9865.0 8195.0)  2135  1805
    Concat \2\1\3\5\,1805
    W- *WARNING* (axlTransformObject): ?move option requires a delta x/y location

    here is an example from the Cadence skill guide:
       axlTransformObject(ldbid, ?move '(100.0, 0.0))


    see my code below...

    (defun MoveIt ()

       Plist=axlGetSelSet()
       axlShell("Done")
      
      ;pick new location
      newlocationX=12000
      newlocationY=10000
      
      ;printf("Plist  %L \n" Plist)
      
      (foreach comp Plist
      
          ;printf("compLoc %L " comp->xy)
          deltaX=round(newlocationX)-round(car(comp->xy))
          deltaY=round(newlocationY)-round(car(cdr(comp->xy)))
       
          printf(" %n  %n \n" deltaX deltaY)
          deltaXY=concat(deltaX "," deltaY)
          printf("Concat %L \n" deltaXY)
          axlTransformObject(comp, ?move 'deltaXY)

      );end for
        
    );


    hope somebody can help!


    Originally posted in cdnusers.org by Geoffm
    • Post Points: 0
  • Thu, Apr 6 2006 12:08 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Moving an object with axlTransformObject Reply


    The move option expects a list of two floating point arguments not a string.
    A string is produced by strcat. Also I don't think you want to round your coordinate
    calculation.

    The following should do it:
     deltaX = newlocationX - car(comp->xy)
     deltaY =  newlocationY - car(cdr(comp->xy))
     
     axlTransformObject(comp ?move list(deltaX deltaY))


    Originally posted in cdnusers.org by fxf
    • Post Points: 0
  • Thu, Apr 6 2006 12:26 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Moving an object with axlTransformObject Reply

    Your solution worked, fxf!

    I guess you don't need the comma between x and y values as in the cadence example.  Also, you used "list" instead of '. That was the only thing I didn't try.

    Thanks again.


    Originally posted in cdnusers.org by Geoffm
    • Post Points: 0
  • Fri, Apr 7 2006 4:42 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Moving an object with axlTransformObject Reply


    Commas are optional and allow for a "C" programming style

    The difference between list and quote (') is that lists causes evaluation while
    the quote doesn't. To show this with a simpe example.

    Assuming:
        dx=10
        dy=20

    Do the following :
          xy = list (dx dy)
    result: xy = (10 20)

    While
          xy = '(dx dy)
    result: xy = (dx dy)

    You can also use the shorthand colon notation in place of list for 2 elements so
          xy=dx:dy
    result: xy = (10 20)



    Originally posted in cdnusers.org by fxf
    • Post Points: 0
  • Wed, Apr 12 2006 12:00 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Moving an object with axlTransformObject Reply

    I was always a bit hazy about, the difference between ' and List. Thanks for the input.


    Originally posted in cdnusers.org by Geoffm
    • Post Points: 0
Page 1 of 1 (5 items)
Sort Posts:
Started by archive at 06 Apr 2006 08:18 AM. Topic has 4 replies.