I am converted some old radio schematics to digital format.
I would like to be able to have a table of the different components each with the coordinates of where that component is on the schematic.
( Will be searching for the textual name of the component (ie C1 C2 -- C25 Or R1 R15 R26), and use coords of the text.
I would like to use VisualBasic dot Net or C# but will be willing to move to other languages if necessary.
Is there a way to get the absolute coordinates of an object reading the SVG?
Any Help Would Be Appreciated!
--alan
For example,
for component C25, I can find the Text:
<flowRoot
transform="matrix(1.8243866,0,0,1.8785325,-3894.3839,-587.48925)"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:25px;font-family:Arial;-inkscape-font-specification:'Arial Bold';text-align:start;text-anchor:start;opacity:1;fill:#ff0000;fill-opacity:1;stroke:#ff0000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99337751"
id="flowRoot4439"
xml:space="preserve">
<flowRegion id="flowRegion4441">
<rect style="stroke:#ff0000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99337751" y="1718" x="2193" height="51" width="61" id="rect4443" />
</flowRegion>
<flowPara id="flowPara4445">C25</flowPara>
</flowRoot>
This is a view of what I am viewing in Inkscape (NOTE: Graphics and other info removed for simplicity)
Zoomed In View Of Coordinates
The SVG is an attachment to this
Determine Absolute Location of Object from SVG
-
- Posts: 5
- Joined: Sat Dec 13, 2014 3:02 am
Determine Absolute Location of Object from SVG
- Attachments
-
- C25_SVG.svg
- SVG written from Inkscape
- (77.77 KiB) Downloaded 315 times
Re: Determine Absolute Location of Object from SVG
You can either look into the selection tool's toolbar at the top of your Inkscape window to get a rough approximation, solve the equations yourself (involving matrix maths) or ask Inkscape to do it for you. If you need precision, I'd go for the latter:
inkscape yourfilename.svg --query-all --query-id yourobjectid
More info here:
https://inkscape.org/en/doc/inkscape-man.html
Lazur will be able to explain how to solve the matrix maths (you will need to take all groups into account that are 'around' the object whose position you'd like to know), if you want to do the maths yourself.
inkscape yourfilename.svg --query-all --query-id yourobjectid
More info here:
https://inkscape.org/en/doc/inkscape-man.html
Lazur will be able to explain how to solve the matrix maths (you will need to take all groups into account that are 'around' the object whose position you'd like to know), if you want to do the maths yourself.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: Determine Absolute Location of Object from SVG
Well I'm not exactly sure what are you after but those texts are flowed and have a stroke set that may cause problems outside inksape.
-
- Posts: 5
- Joined: Sat Dec 13, 2014 3:02 am
Re: Determine Absolute Location of Object from SVG
Moini - thanks will check that out
Lazur: I just want to get a coordinate (x,y) of a point somewhere within the text object.
I am not going to use the SVG outside of inkscape - except for reading the XML to get the coordinate
Lazur: I just want to get a coordinate (x,y) of a point somewhere within the text object.
I am not going to use the SVG outside of inkscape - except for reading the XML to get the coordinate
Re: Determine Absolute Location of Object from SVG
If it is a text object, it may be necessary to convert it to a path to be able to select a specific letter (Path -> Object to Path). After this operation, the text will no longer be editable as text (if it was before).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
-
- Posts: 5
- Joined: Sat Dec 13, 2014 3:02 am
Re: Determine Absolute Location of Object from SVG
Moini,
I am just looking for a "close" coordinate, the coordinates will be used to help find a component, so it is not necessary to have an
exact location for the text object.
I am just looking for a "close" coordinate, the coordinates will be used to help find a component, so it is not necessary to have an
exact location for the text object.
Re: Determine Absolute Location of Object from SVG
In that case, any of the mentioned methods will probably do If you need it to work programmatically, I'd suggest the (exact...) commandline method.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
-
- Posts: 5
- Joined: Sat Dec 13, 2014 3:02 am
Re: Determine Absolute Location of Object from SVG
Yes, the command line will work and provide me with coordinates.
I do need to take the viewbox into consideration, otherwise all is well!
Thank you guys!
I do need to take the viewbox into consideration, otherwise all is well!
Thank you guys!