Load a layer property file into a layout using Python scripts


I have two basic questions that I would really appreciate if someone can answer.

I want to load a layer property file (.lyp) to my layout through the Python script that I have already created for that layout, and connect the layer properties in that file to the ones I developed using the script. Is there a simple way to do this on Python scripts?

I believe in order to connect the layers in my layer property file to the layers in the layout, I have to use the same index in my codes, right? I mean, for example, I have a layer named "METAL" in the layer-property file that has an index of (1,0). So, if I use the same index (let's say (1,0)) in my codes, basically they should be connected after I run my codes and load the layer property file. Is this the right way to do this or is there any more convenient way?

Thanks in advance.



  • Hi, Mo!

    See load_layer_props methods of LayoutView class.

  • I have a question, which I can't recall whether
    I've asked directly.

    That is, is there a logging of the interactive command
    stream, from which series of user actions turned into
    native commands could be "harvested"? Maybe even
    in a form directly mappable to these "class items"?

    I think back to my years using "Brand C" and how
    often we'd make SKILL widgets by grabbing a
    snippet from the CDS.log file. It could be neat to have
    the ability (or maybe we do) to make macros from
    GUI actions, either in-the-moment or by harvesting.

    Of course I have no idea whether the GUI driven
    actions have any intersection with Python or Ruby,
    as well as the question of whether they are logged

  • @dick_freebird

    The classic way of code golfing :),
    looking through the CDS.log or the icfb

  • edited March 2021

    Hi Mo,
    Yes you can define this in your layer tech file

    The following is an example to change layers to have names.
    I have placed example copy on github here
    Just copy and paste and save as tech.lyp

  • Thank you @EugeneZelenko and @tagger5896 for the explanation. Great solutions! :)

Sign In or Register to comment.