Git Product home page Git Product logo

Comments (42)

juulsA avatar juulsA commented on May 24, 2024

Unfortunetly this is a question I can't answer ... all programming and tests were done with 17.4. Based on the error I can guess, that the program is trying to access a value from an element that does not exist ... I try to add some debug messages to the code, so we can figure where this is happening ... thanks to cadence the line where the error occurs is not printed to the console ... but please give me some time for this.

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

another hint: all actions need to be completed / closed by clicking 'done', otherwise the skill scripts often do not run properly ... but I don't think, that this is the case here ...

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

I've found the place where this error appears in the code:

image

Changing var Extents helps to avoid error.

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Thanks for your help! Maybe I have to add some lines of code, so that the script does not run into this error ... maybe the pcb editor 16.6 does not support the dsn->designOutline or the axlDBGetExtents call ... could you check what is the output of the outline, segments and extents by typing the following to the skill command line?

open the skill comand line ( set teslkill )

dsn = axlDBGetDesign()
outline = dsn->designOutline

outline should print somethings like this dbid:000001B548763A30

segments = outline->segments

should print a list of dbids

extents = axlDBGetExtents( segments nil )

prints two coordinates, if everything works as intended.

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

On the next step I receive this error:

image

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

seems like version 16.6 and 17.4 differs in their default layers ... the BOARD GEOMETRY/CUTOUT is a fixed layer in 17.4 ...
If you don't have any cutouts you can comment the whole "add cutout to edges list" commands (add a ; to each line)

cutout = car( axlDBGetShapes( "BOARD GEOMETRY/CUTOUT" ) )
segments = cutout->segments

    foreach( segment segments
        ; parse segment
        if( pcbLinewidth then 
            element = parseSegment( segment pcbLinewidth )  
        else
            element = parseSegment( segment segment->width )  
        )

        if( boundp( 'edges ) then
            tconc( edges element )
        else
            edges = tconc( nil element )
        )      
    )

or change the layer name to the correct layer name.

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

I have this result for Outline:

image

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

I've added ; to all lines

image

But error is the same:

image

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

I've added ; to the next block:

image

Now the next error is:

image

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

okay... yeah, sorry, I forgot, that we don't have any information for the board outline now (dsn->boardOutline is nil) ... and edges is an unbound ... maybe we can check, if this is the only error we are running in.

Please do the following:

Comment out the addBoardGeometry and execute exportJson

The function should complete, if there are no further "mistakes". If this works, we try to find a solution for our initial problem.

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

After commenting export did complete. Would it be useful to attach .json file here?

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

I have this list of layers:

image
image

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

After commenting export did complete. Would it be useful to attach .json file here?

No, I don't need the .json file, but now we know, that we just need to modify the addBoardGeometry function.

Does this prints any dbids?

segments = car( axlDBGetShapes( "Board Geometry/Design_Outline" ) )

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

image

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

I set extents = margin to prevent error about nil, if it matters.

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

I set extents = margin to prevent error about nil, if it matters.

I don't think this is a problem. Can you find out, what's the name of the pcb contour layer and the cutouts? And then execute the previous command with the layer name?

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

Outline:

Skill > segments = car( axlDBGetShapes( "Board Geometry/Outline" ) ) dbid:376073928 Skill >

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Then you don't need the lines 686 - 688:

Can be removed:
dsn = axlDBGetDesign()
outline = dsn->designOutline
segments = outline->segments

and replaced by:
segments = car( axlDBGetShapes( "Board Geometry/Outline" ) )

Maybe you can try, if extents = axlDBGetExtents( segments nil ) is working now, otherwise leave it as you modified it.

Uncomment the previously commented line addBoardGeometry and give the exportJson a new try.

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

Now I get this kind of error:
E- *Error* foreach: second argument must be a list - dbid:177495752

Maybe the issue is in Cutout layer? I can't find it, the only similar layer name is Cut_marks. But for this layer I have:

Skill > segments = car( axlDBGetShapes( "Board Geometry/Cut_Marks" ) )
nil

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

To get this running without the cutout layer (comment line 726 - 739).

Does this error returns from the call axlDBGetExtents ( ... )? Then please modify it the way you have done it before.

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

All variants give the same result:
E- *Error* foreach: second argument must be a list - dbid:177495752

Only if I comment lines 707-750, export can complete.

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

My mistake ...
it should be:

outline = car( axlDBGetShapes( "Board Geometry/Outline" ) )
segments = outline->segments

instead of only

segments = car( axlDBGetShapes( "Board Geometry/Outline" ) )

Please try this.

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

Now it works! You made great script, Thank You!
And Thank You for help!

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Ok, great! I'll check, if I can solve the issue with a few lines of code, so that the script is also working for older versions of allegro.
Thank you for reporting this issue ;)

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Please check my latest version of the script, which should handle all layers correctly.

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

The latest version works properly with ver. 16.6! Thank you!

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

I found out, that in HTML all elements are located on Back side and Front side is empty. File from the example works correct, and file .json that was made in ver. 16.6 has this error.

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Can you share the .json file?

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

My.txt

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

As I understand, in this line, for example, should be "layer": "F"?
image

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Yes, if I run the script on this project the layer is set to "F".

Can you add the following to line 1381:

print( symbol->layer )

And tell me what is the output? Thanks!

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Result is the same, Front is empty

AD-FMComms3.txt

The command should have printed something to your command line.

But I think I have to change the code there ... please have some patience

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

I added line print( symbol->layer ) to file exportJson, is it my mistake?
Should I add it to file .json?

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

No, to the exportJson.il. But please check my latest commit, I hope, I fixed it.

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

Still the same result: emprty Front side.

AD-FMComms3.txt

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

And do you have an opportunity to open my .json file in iBOM? Maybe mistake is only on my side?

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

In .json we need here and for the same elements "F":

image

This way iBom would work correct.

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Yes, this is what I just saw ... But please do this as I described above and make your command line visible, because the information I need is only printed to the command line. And tell me the results.

Yes, if I run the script on this project the layer is set to "F".

Can you add the following to line 1381:

print( symbol->layer )

And tell me what is the output? Thanks!

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

I've added here:

              ; get symbol layer
		print( symbol->layer )
                if( symbol->layer == "TOP" then
                    layer = "\"F\""
                else
                    layer = "\"B\""
                )

This is result in command line:

Command > exportJson
CDS version: 16.600000
nilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnil"Export complete!"
W- *WARNING* No variant.lst found, exporting entire design ... 
Command > 

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Ok, give me some time to make some changes to the code.

from exportjson.

juulsA avatar juulsA commented on May 24, 2024

Please update to the latest version and give it another try ... hopefully it works now!

from exportjson.

Kartohen avatar Kartohen commented on May 24, 2024

Now everything is alright! Thank You!

from exportjson.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.