Home > Community > Forums > PCB SKILL > create symbol with skill

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

 create symbol with skill 

Last post Tue, Jan 22 2013 4:24 AM by Yann00. 9 replies.
Started by Ejlersen 08 Sep 2010 10:25 AM. Topic has 9 replies and 4468 views
Page 1 of 1 (10 items)
Sort Posts:
  • Wed, Sep 8 2010 10:25 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    create symbol with skill Reply

    Hi

    I have a text file with coordinates for a number of shape symbols that I need to create. My problem is how I inside skill can create a new .dra file and then draw the shape and save the .dra/ssm file.

    I've look at numerous axl functions without getting something to work - does anyone have an idea?

    I could probably create scripts to generate new shape symbols and save them using scripts, but I would rather avoid using scripts. 

    Best regards

    Ole

    Best regards Ole
    • Post Points: 50
  • Wed, Sep 8 2010 1:16 PM

    • aCraig
    • Top 50 Contributor
    • Joined on Sat, Aug 16 2008
    • Pepperell, MA
    • Posts 132
    • Points 2,070
    Re: create symbol with skill Reply

    Hi Ole,

    Have you tried  "axlDBCreateSymDefSkeleton"? I've use this to create new symbols in a design.

    -Craig

    • Post Points: 5
  • Wed, Sep 8 2010 1:18 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 744
    • Points 16,115
    Re: create symbol with skill Reply

    Hi Ole,

    If I understand your problem correctly you want to create a symbol without leaving your current design session?

    I can't think of a non-script way to do that but I get around the problem with a series of tricks to save my current design, open the symbol editor, create my symbol and re-open the original design:

        draName = "myDra"
       
        currentDesign = axlCurrentDesign()
        state = axlSaveEnable()
        tempDesignName = "temp.brd"
        axlSaveDesign(?design tempDesignName, ?mode "nocheck", ?noMru t)
        AFn_OpenDesign(?design strcat(draName, ".dra"), ?mode "wf", ?noMru t, ?noConfirm t, ?forceNew t)
        axlSetSymbolType("shape")
        ;...
       
        AFn_OpenDesign(?design tempDesignName, ?mode "wf", ?noMru t, ?noConfirm t)
        axlSaveDesign(?noMru t)
        axlRenameDesign(currentDesign)
        deleteFile(tempDesignName)
        axlSaveEnable(state)

    defun( AFn_OpenDesign (@key design, (mode "w"), noMru, noConfirm, forceNew)
     let((noconfirmStatus, result)
      when(noConfirm, noconfirmStatus = axlGetVariable("NOCONFIRM"), axlSetVariable("NOCONFIRM", t))
      when(forceNew && isFile(design), deleteFile(design))
      result = if(noMru && axlVersion('version) >= 16.0
       then axlOpenDesign(?design design, ?mode mode, ?noMru t)
       else axlOpenDesign(?design design, ?mode mode)
      )
      when(noConfirm, if(noconfirmStatus then axlSetVariable("NOCONFIRM", t) else axlUnsetVariable("NOCONFIRM")))
      result
    ))

    Regards,

    Dave

    Dave Elder, Tait Communications
    • Post Points: 35
  • Fri, Sep 10 2010 2:53 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: create symbol with skill Reply

    Hi Dave

    Thanks for the tip, I'll try it out.

    Best regards

    Ole

    Best regards Ole
    • Post Points: 5
  • Sun, Oct 3 2010 8:05 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: create symbol with skill Reply

    Hi Dave

    This seems to work fine, a small correction

    you need to run axlSaveDesign before AFn_OpenDesign in the end to save of the symbol

    I was wondering if you have a method to write the symbol file also, I can only get it to save the .dra file

    Best regards

    Ole

    Best regards Ole
    • Post Points: 20
  • Sun, Oct 3 2010 11:52 AM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 744
    • Points 16,115
    Re: create symbol with skill Reply

    Hi Ole,

    axlSaveDesign should also create the compile the symbol if you are in the drawing editor.

    Regards,

    Dave

    Dave Elder, Tait Communications
    • Post Points: 20
  • Mon, Oct 4 2010 7:16 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: create symbol with skill Reply

    Hi Dave

    Thats weird, since the code does contain "axlSaveDesign(?noMru t)" so that should be fine, but only the .dra file is saved, no ssm.

    Maybe its because I only run the defun and not the complete skill program?

    Best regards

    Ole

    Best regards Ole
    • Post Points: 20
  • Mon, Jan 21 2013 7:18 AM

    • Yann00
    • Top 200 Contributor
    • Joined on Tue, Dec 4 2012
    • Posts 42
    • Points 585
    Re: create symbol with skill Reply

    hi Dave and Ejlersen,

    Did you solve your problem?

    Because I want to create file.osm associated to my .dra file. And axlSaveDesign does only create my .dra file.

    Have you got any solution for that? Thanks

    • Post Points: 5
  • Mon, Jan 21 2013 7:25 AM

    • djhutchi
    • Top 100 Contributor
    • Joined on Fri, Nov 14 2008
    • Hillsboro, OR
    • Posts 70
    • Points 870
    RE: create symbol with skill Reply
    Try using axlCompileSymbol

    axlCompileSymbol(

        [?symbol t_name]

        [?type t_type]

        [?silent t/nil]

        [?silentOnOverwrite t/nil]

    )
    • Post Points: 20
  • Tue, Jan 22 2013 4:24 AM

    • Yann00
    • Top 200 Contributor
    • Joined on Tue, Dec 4 2012
    • Posts 42
    • Points 585
    Re: RE: create symbol with skill Reply

    Thanks a lot, it works.

    Just an information: You have to do that after axlSaveDesign of your file.dra

    Otherwise it does not compile the symbol.osm

    • Post Points: 5
Page 1 of 1 (10 items)
Sort Posts:
Started by Ejlersen at 08 Sep 2010 10:25 AM. Topic has 9 replies.