Home > Community > Forums > PCB SKILL > Skill code to move component

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: *

 Skill code to move component 

Last post Fri, Jun 29 2012 10:24 AM by Mstrghettorigg. 34 replies.
Started by archive 29 Mar 2006 03:07 AM. Topic has 34 replies and 14046 views
Page 1 of 3 (35 items) 1 2 3 Next >
Sort Posts:
  • Wed, Mar 29 2006 3:07 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    Skill code to move component Reply

    Hi,
    I'm trying to generate a skill program that launches place manual -hide and then picks a specific coordinate to pick up the component placed in that coordinate.

    I know that I have a pin placed in 0,0 and would like the skill program to pick that coordinate and leave the component on the mouse for me to place manually.

    I've tried doing the following
    axlShell("place manual -h")
    axlShell("pick 0 0")

    and I've also tried running a script that I've recorded that does the exact same, but both methods fail. They do launch the place manual command but I cannot get skill to pick that coordinate so that it is left for me to move the component

    Does anyone have some good ideas, thanks.

    Best regards,
    Ole


    Originally posted in cdnusers.org by ejlersen
    • Post Points: 20
  • Thu, Mar 30 2006 8:22 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi,

    I found out some more

    I can use the following code
    Command=strcat("place manual refdes" refdes_name)
    axlShell(Command)

    The only demand here is that the refdes_name is an unplaced symbol, I'm however missing 2 things if I do this.
    1. After typing the command at the command line I would like to skill program to make the PCB editor window the main window - otherwise my shortcuts for rotate, mirror etc. does not work.
    2. After the part is placed the place manual dialog is still shown and I would like it to close automatically after the user places the component

    Does anyone know how to accomplish these 2 things?


    Originally posted in cdnusers.org by ejlersen
    • Post Points: 5
  • Thu, Mar 30 2006 12:51 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi Ole,

    Without knowing exactly what you are trying to do it is difficult to offer help.
    However, I don't think many of us would try to do this type of function using Shell commands. I suggest that you look up the axlDynamicsObject and axlEnterEvent functions and base some code around those.

    I can give you some sample code if I know what you are trying to do, and why.

    Cheers, Dave


    Originally posted in cdnusers.org by Dave Elder
    • Post Points: 35
  • Thu, Mar 30 2006 2:32 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    I think I understand what you are trying to do.
    Here is a couple ways of handling this:

    From the Allegro Command line via a script:
       place manual -h ; pick 0 0

    From inside of Allegro SKILL
       axlShell("place manual -h ; pick 0 0")

    I am sure there is different ways of performing this inside of
    Allegro SKILL but the basic command above do what you are
    looking for.

    Hope this helps,
    Mike Catrambone
    UTStarcom, Inc.


    Originally posted in cdnusers.org by mcatramb91
    • Post Points: 0
  • Thu, Mar 30 2006 3:48 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    If the main idea is to place a component, you can use axlDBCreateSymbol.

    The benefit of this is, you know if the component was placed correctly as this procedure will return the dbid or nil.

    From Cadence documentation:
    axlDBCreateSymbol(
                 t_refdes
                 l_anchorPoint
                 [g_mirror]
                 [f_rotation]
             )

    example:
    ;; place component C1 at point (x,y) on the top of the substrate
    ;; with 90 degree rotation
       axlDBCreateSymbol("C1", list(x, y), nil, 90.0)


    Originally posted in cdnusers.org by natebizu
    • Post Points: 0
  • Thu, Mar 30 2006 4:50 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    The following will do it

    (procedure ptest()
            cmd = "place manual -hide; pick 0 0"
            axlShell(cmd)
    )

    Restrictions:  
       1) Do not register this as an Allegro command via axlCmdRegister
           or you will find Allegro will immediately terminate the place manual command.
          Instead call it via Skill ex: skill "ptest"
       2) Make certain your pick from Skill is on a visiable portion of the symbol (not its
           center uness you have something like place bound on). Pins are typically visible.


    Originally posted in cdnusers.org by fxf
    • Post Points: 0
  • Fri, Mar 31 2006 12:00 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply
    Hi Dave, Mike et al,

    Let me see if I can explain this better.
    Normally you would use place manual and select a specific reference designator that should be moved or placed(if unplaced)

    Instead I would like to write mc c1 in the command line and it should launch manual place in hide mode and attach C1 to the cursor for me to place whereever I want.

    As soon as the component is placed the manual place dialog should close down again and the Allegro PCB Editor should be left in idle mode.

    I've attached a skill program find_cmp.il which basically does what I would like to do with respect to move/place manual. I've also attached my own revision called move_cmp.il which works almost as expected. writing mc c1 in the command line brings c1 to the cursor for movement - I can however not use my shortcuts (r iangle 90 or o pop mirror) and when I place the component the place manual dialog is still open.

    I've looked through tons of skill code and also all the examples in share\pcb\examples\skill without finding anything that I could use or some good examples. All code that I can find places objects at specific coordinates which is not what I'm looking for - I've tried looking at the dynamicobjects functions but they're very sparse documented and there's no examples that I can use to understand this better - some of them are written in pseudocode which cannot just be launched for test.

    I hope someone knows more about this and can help me, thanks in advance.


    Best regards,
    Ole


    Originally posted in cdnusers.org by ejlersen
    • Post Points: 5
  • Sun, Apr 2 2006 6:06 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi Ole,

    Attached is some simple code that might help. It demonstrates use of dynamic objects, events, popups and transactions.
    It uses some "private" Cadence functions, and some dubious coding of my own for the popups, so use with care. However, I have tested it in 15.2 and 15.5.1 and it possibly does what you want.

    It will place symbols off grid. You could fix this by changing the third argument of  axEnterEvent to t and/or change event ->xy to event ->xySnap.

    Cheers, Dave


    Originally posted in cdnusers.org by Dave Elder
    • Post Points: 0
  • Tue, Apr 4 2006 2:29 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi Dave,

    This is actually what I'm looking for - this is great.
    I can see that you've added the popup menu items - do you know if it is possible also to create keyboard shortcuts that are available during this command?
    E.g., pressing R instead of choosing right click and rotate.

    Best regards,
    Ole


    Originally posted in cdnusers.org by ejlersen
    • Post Points: 0
  • Tue, Apr 4 2006 5:05 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi Ole,

    Try this. I have added keyboard shortcuts and fixed some small bugs.

    Cheers, Dave


    Originally posted in cdnusers.org by Dave Elder
    • Post Points: 0
  • Thu, Jun 15 2006 6:53 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi Dave,

    I found an issue, but not the solution yet.
    If you pick up a part like shown in the movie at http://www.allegro-pcb.dk/movies/movebyrefdes/movebyrefdes.html you'll see the issue.

    I've tried changing the code, but somehow it is related to the first pick made, do you have any suggestions.

    Best regards,
    Ole


    Originally posted in cdnusers.org by ejlersen
    • Post Points: 0
  • Thu, Jun 15 2006 9:21 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi Ole,

    Took me a while to figure that one out!
    Here's some improved code. Please let me know if it is actually better.

    Cheers, Dave


    Originally posted in cdnusers.org by Dave Elder
    • Post Points: 0
  • Fri, Jun 16 2006 3:08 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi Dave,

    This seems to work, so thanks a lot for this Dave.

    Ole


    Originally posted in cdnusers.org by ejlersen
    • Post Points: 0
  • Mon, Jun 26 2006 6:02 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi Dave,

    Do you know if it there exist a command to add the ratsnests to the components during a move command?

    Best regards,
    Ole


    Originally posted in cdnusers.org by ejlersen
    • Post Points: 0
  • Tue, Jun 27 2006 4:36 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    RE: Skill code to move component Reply

    Hi Ole,

    It is possible but my attached code uses some more private functions.

    Cheers, Dave


    Originally posted in cdnusers.org by Dave Elder
    • Post Points: 20
Page 1 of 3 (35 items) 1 2 3 Next >
Sort Posts:
Started by archive at 29 Mar 2006 03:07 AM. Topic has 34 replies.