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 locationhere 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!
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 coordinatecalculation.The following should do it: deltaX = newlocationX - car(comp->xy) deltaY = newlocationY - car(cdr(comp->xy)) axlTransformObject(comp ?move list(deltaX deltaY))
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.
Commas are optional and allow for a "C" programming styleThe difference between list and quote (') is that lists causes evaluation whilethe quote doesn't. To show this with a simpe example. Assuming: dx=10 dy=20Do 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:dyresult: xy = (10 20)
I was always a bit hazy about, the difference between ' and List. Thanks for the input.