Git Product home page Git Product logo

Comments (21)

juulsA avatar juulsA commented on May 29, 2024 1

Github removes the important thing ...

Within a string a " needs to be escaped by a \. So the solution is

"\"pin\": \"" pinNumber "\"" 

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

If I have a folder of brd files can I automate the json export of them?

from exportjson.

juulsA avatar juulsA commented on May 29, 2024

Is there anyway I could run a command on windows command prompt to export the json? The export to html in one step code you had. Where do I put that?

You have to create your own procedure / *.il file it is just a code snippet. And yes you can automate it, but for this you need to write custom code.

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

from exportjson.

juulsA avatar juulsA commented on May 29, 2024

Maybe there is a way using python and the command line, but I do not know how this could be done. I would use skill, because the export has to be done from the allegro editor anyway.

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

Hey, is there anyway I can extract the pins associated with each component?

from exportjson.

juulsA avatar juulsA commented on May 29, 2024

Hi,
if you take a look at the .json-file, you can see, that all pins associated to a component are grouped (search for "footprints:").
If this is what you need, you can use the addFootprint function and change it to your needs.

Regards!

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

Thanks, Now I want the pin number of these associated pins. Is there a way to add this information to the json and still allow the json to work for the interactiveHTMLBom?

from exportjson.

juulsA avatar juulsA commented on May 29, 2024

I'm not sure, but you could test it, if you add the line to your code. You could use the pinNumber property and add it to the pad definition.

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

hi, I appreciate the help btw. So i am using the pinNumber property and it fills in some of the pins as empty strings whihc is causing a parsin error in the jsons. Im guessing its because they dont have pin numbers. How would I fix this so even if there is no pinNumber I wont get a parsing issue in the json?

from exportjson.

juulsA avatar juulsA commented on May 29, 2024

you could or you should check if the pinNumber is not nil and set a default, if the pinNumber has no value.
This can be done by:

if( pinNumber then
   ; set the pinNumber
else 
  ; set a default value
)

I hope this helps ...

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

okay so the issue is actually with the type cast of pinNumber. How do I insert the pinNumber value so it gets parsed? I guess unless it is a number it isnt working. For example if a pin is G14 Im getting the error

from exportjson.

juulsA avatar juulsA commented on May 29, 2024

Try this 'sprintf( nil "%L pinNumber )'

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

where should I insert this? When I tried to replace just where I referenced "pinNumber" with that line I got this error
function figureToSvgPath redefined
E-
E- pad = strcat( pad ",\n"
E- ^
E- svgpath
E- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
E- )
E- ^^^^^^^^^^^^^^^^^
E- )
E- ^^^^^^^^^^^^^
E-
E-
E-
E-
E- ; if present, add the drill information
E- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E- when( boundp( 'drill )
E- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E- ;build pad
E- ^^^^^^^^^^^^^^^^^^^^^^^^^^
E- pad = strcat( pad ",\n" drill )
E- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E- SYNTAX ERROR found at line 1207 column 39 of file exportJson.il
E- Error lineread/read: syntax error encountered in input
E- Error load: error while loading file - "exportJson.il" at line 1216
ERROR

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

wait I figured it out, pad = strcat(
""layers": " layers ",\n"
""pos": " pos ",\n"
""size": " size ",\n"
""angle": " angle ",\n"
""shape": " shape ",\n"
""net": " net ",\n"
""type": " type ",\n"
""pin": " pinNumber
)
this is how I added pin number, now the issue is that the actual pin vlaue number doesnt come out in quotes like the rest do. How do I make the value come in quotes. Fro example:
"layers": ["B"],
"pos": [ 2430.940000, 25.580000],
"size": [ 38.000000, 38.000000],
"angle": 0.000000,
"shape": "circle",
"net": "L/G",
"type": "smd",
"pin": G16

this is how it come out but it should be "pin": "G16"

from exportjson.

juulsA avatar juulsA commented on May 29, 2024

Yes, you need to add the quotation marks by " within the string.

""pin:" "" punNumber """

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

sorry that was the output this is the code, getting a few errors with quotes

pad = strcat(
""layers": " layers ",\n"
""pos": " pos ",\n"
""size": " size ",\n"
""angle": " angle ",\n"
""shape": " shape ",\n"
""net": " net ",\n"
""type": " type ",\n"
""pin": " pinNumber
)
how would I change it here sorry

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

image
It is still coming out like this. I was hoping it would come out like this: "pin": "G12"

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

is there anyway for me to define pinNumber or pin->number as a string?

from exportjson.

juulsA avatar juulsA commented on May 29, 2024

It is already a string, since you are using the strcat ... there is something wrong in your code ... please have a look at this line. You have to do it the same way, except, that you have to use your variable pinNumber instead of circle.

from exportjson.

ankithjv avatar ankithjv commented on May 29, 2024

ahhhh yes it finally worked thank you so much for helping me so much.

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.