Comments (21)
Github removes the important thing ...
Within a string a "
needs to be escaped by a \
. So the solution is
"\"pin\": \"" pinNumber "\""
from exportjson.
If I have a folder of brd files can I automate the json export of them?
from exportjson.
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.
from exportjson.
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.
Hey, is there anyway I can extract the pins associated with each component?
from exportjson.
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.
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.
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.
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.
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.
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.
Try this 'sprintf( nil "%L pinNumber )'
from exportjson.
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.
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.
Yes, you need to add the quotation marks by " within the string.
""pin:" "" punNumber """
from exportjson.
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.
It is still coming out like this. I was hoping it would come out like this: "pin": "G12"
from exportjson.
is there anyway for me to define pinNumber or pin->number as a string?
from exportjson.
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.
ahhhh yes it finally worked thank you so much for helping me so much.
from exportjson.
Related Issues (11)
- PCB Designer 16.6 HOT 42
- exportJson error:can't handle (nil - 0.0) HOT 11
- Does this change the actual alegro file as well? HOT 18
- Opportunity to convert several Outline shapes to json for Allegro 16.6 HOT 6
- *Error* difference: can't handle (nil-0.0) HOT 5
- Hello! Can other parameters be added to the BOM? For example, self-defined parameters such as' VOLTAGE 'or' Tolerance ' HOT 4
- Can't parse json with cutouts HOT 10
- Thieving export and missing dummy lines HOT 9
- Dummy net lines are absent HOT 3
- Customizable output layer mapping HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exportjson.