element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Autodesk EAGLE
  • Products
  • More
Autodesk EAGLE
EAGLE User Support (English) ULP instantaneous command execution
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Autodesk EAGLE to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 3 replies
  • Subscribers 177 subscribers
  • Views 295 views
  • Users 0 members are here
  • ulp
  • command
Related

ULP instantaneous command execution

Former Member
Former Member over 11 years ago

I'm starting to use ULP scripting, but I'm lacking some important functions.

 

1. Some actions on the sch/brd seems to be only possible through script/exit(), not through ULP

     for example I want to delete a part.

     The only way I had found is adding "detele partName" to the (possibly very long) string that will be executed after the ULP finishes

     or a Copy part, is possible at the end of the ULP, but in this way I cannot make any changes on it.

     Is there a better/instantaneous way to make serious changes (like delete or duplicate parts)?

 

2. Some actions that are possible by clicking command buttons are not possible in scripting. I'm not able to make a copy of a part in schematic by script.

     Having part U1, "copy U1 U2" generates an error message (The copy command with a name can only be used in a library!)

     Setting group and executing "Cut; Paste" requires action of a mouse.

 

Pavel

  • Sign in to reply
  • Cancel
  • autodeskguest
    autodeskguest over 11 years ago

    On 21/08/14 09:06, Pavel Soukup wrote:

    I'm starting to use ULP scripting, but I'm lacking some important

    functions.

     

    1. Some actions on the sch/brd seems to be only possible through

    script/exit(), not through ULP

         for example I want to delete a part.

     

    Yes, that is a known limitation of the user language. There are all

    sorts of hacks to work around it but still, it sucks.

     

    2. Some actions that are possible by clicking command buttons are not

    possible in scripting. I'm not able to make a copy of a part in

    schematic by script.

     

    You can simulate mouse clicks by giving coordinates.

     

         Having part U1, "copy U1 U2" generates an error message (The copy

    command with a name can only be used in a library!)

     

    If U1 is located at (2.7 3.7) and you want U2 at (5.0 4.2) then you can

    issue:

            copy (2.7 3.7) (5.0 4.2);

     

    This will create a copy. It doesn't guarantee it'll be called U2,

    especially if it's not allowed to be called U2 (because U2 already

    exists, for example).

     

         Setting group and executing "Cut; Paste" requires action of a

    mouse.

     

    In theory, again, this should be possible :

            group (c 3.2 2.7) (c 5.2 2.8);

       defines a group containing the components located at (3.2 2.7) and at

    (5.2 2.8). Note the "(c xxx)" syntax to simulate a mouse click with the

    control key (see help for the group command).

            cut (4.2 2.7);

       will put that group in the cut/paste buffer with an anchor in the

    middle, and

            paste (8 2);

       will place a copy off to the right.

     

    The trick is to construct all these lists of coordinates by analysis of

    the objects on the page, which is left as an exercise for the reader.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 11 years ago in reply to autodeskguest

    On 21/08/14 18:26, Rob Pearce wrote:

    On 21/08/14 09:06, Pavel Soukup wrote:

    I'm starting to use ULP scripting, but I'm lacking some important

    functions.

     

    1. Some actions on the sch/brd seems to be only possible through

    script/exit(), not through ULP

         for example I want to delete a part.

    Yes, that is a known limitation of the user language. There are all

    sorts of hacks to work around it but still, it sucks.

     

     

    Sorry, bad form to follow up my own post, but I forgot to say...

     

    Although this limitation sucks, I can entirely understand why it might

    exist. Being able to modify the schematic in the middle of a loop

    iterating over the objects in that schematic raises all sorts of

    gotchas. Enforcing a strict "analyse, decide, construct action list,

    then act" order helps avoid foot shooting.

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 11 years ago

    On 21/08/2014 8:06 p.m., Pavel Soukup wrote:

    I'm starting to use ULP scripting, but I'm lacking some important

    functions.

     

    1. Some actions on the sch/brd seems to be only possible through

    script/exit(), not through ULP

     

    There are a bunch of actions that can be done from within the ULP. But

    anything that changes your design is done on exit from the ULP.

     

    Sometimes you exit and immediately re-enter the ULP to achieve a change.

    e.g. exit (do something; "run my uLP";)

     

     

          for example I want to delete a part.

          The only way I had found is adding "detele partName" to the

    (possibly very long) string that will be executed after the ULP finishes

          or a Copy part, is possible at the end of the ULP, but in this way

    I cannot make any changes on it.

          Is there a better/instantaneous way to make serious changes (like

    delete or duplicate parts)?

     

    Sometimes you exit and immediately re-enter the ULP to achieve a change.

    e.g. exit ("delete part"; "run my uLP";)

     

    2. Some actions that are possible by clicking command buttons are not

    possible in scripting. I'm not able to make a copy of a part in

    schematic by script.

     

    The part of interest is in a library so simply use the ULP to determine

    the library and device name and ADD it to the schematic at the chosen

    location once the ULP exits. Multiple gate devices may be tricky to get

    right though.

     

    If it's a sch/brd pair you have acquired and does not use your libraries

    , you can use the ULP exp-lbrs.ulp to export and create a new library of

    its parts and draw from that.

     

    HTH

    Warren

     

     

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube