I’m relatively new to the XD development.
What I’m trying to do is replicate the adobe XD artboard in a web VR space, for this to happen I’m looking for a possible way to get data of elements such as distance between X element and Y.
Thank you
Hi @saud, welcome to the community!
In order to get the distance between X and Y, you will have to get the bounds of X and Y first.
Depending on your use case, you might want different types of bounds, but typically, you would want to use boundsInparent. This will give you X,Y coordinates of the selected node relative to its parent node’s coordinates.
Hope this helps!
Hey, Steve thank you so much for the welcome and reply. I’ll let you know the details of my use case.
Usage: I’m working on an XD plugin that will take all the elements of an artboard, including X and Y coordinates and then send those values to a webvr space and render the artboard in webvr.
I do have some questions about boundsInparent:
Can I select all the elements in an artboard without using “selection”?
Can I use socket.io and amazon-sdk in the plugin (npm packages).
Is an artboard an valid parentNode?
Can I get artboards total size?
sorry for the typos
-
All plugin commands work based on user’s selection. If you user has not selected anything, selection defaults to the rootNode. You can traverse down from that to access all artboards.
-
WebSocket is supported.
-
Some npm packages should work, but since XD is not a browser environment, you might have to tweak the libraries sometimes to make them work in XD
-
An artboard is a parent node of all children that belong to the artboard
-
When you say size, do you mean width and height? yes - artboards have
width
andheight
properties
Got it, thanks for the clarification.
One last thing:
Can I export children of artboard programmatically as images? I want them to upload to aws after converting/exporting them to images
Hi @saud,
to export renditions:
https://adobexdplatform.com/plugin-docs/tutorials/how-to-export-a-rendition
Thank you Paolo.
This is such a great community. Props to Paolo and Steve for actively contributing!
Can we also export as batches using this API?
hope it helps:
https://github.com/paolobiagini/xd-app-icon-generator
Thank you, this works for me