Custom Items
Make diagrams your own, by adding new SVGs or images.
Written By Clayton Combe
Last updated 12 months ago
Adding Custom Items
Video transcript:
Video transcript:
It's release day and we have something really special this week because we realized something. We can never know everything you'll need to put on a diagram. There are just too many possibilities. So, we thought let's let you decide. So, now for pro accounts, you have custom items. And as you switch it up here, you'll see I've been experimenting with this a little bit, but I'm going to add a new custom item. And I can choose a file. Because I'm using the web version, I'm just choosing for my computer. And I'm going to choose an SVG. That is our preferred format. It's what we use uh in scenario for our built-in library. Um and I'm just going to choose the film camera here. And you'll see we can play around with it a little bit. I'm going to need to give it a name. And it's going to show me what the scale is. Uh for one foot it's 48 pixels. If uh you're using meters, it's 1 meter equals 160 pixels. That way you know it's going to show up the right size. And I'll make a separate video about how to actually build these. Uh, but for now, I'm just going to go ahead and save it. And now it's here. Just like any other item, I can drag it onto the diagram because it's a fixture. I can make it target stuff and it targets them. I can duplicate it. And because I have set this up in the very specific way that you're supposed to, I can even change its color. So, it works the exact same way as a regular scenario item. We can't wait to see what you add with these. Right now, you can only add them when they're when you're online, but we're working on a way to do it while you're offline. Um, and you can add images, you can add SVGs, like I mentioned. Um, but you know, we prefer the SVGs because you can change the color and treat them normally. We can't wait to see what you put on your diagrams. Enjoy.
Available for Scenario Pro subscriptions
(Currently) only for online use
Items added on one device will sync to all other devices on that account
Building SVGs
This allows custom items to behave nicely based on the rules we use for our built-in items, and change colors with our controls.
Video transcript:
Video transcript:
So, let's talk about how to set up a custom item so that it can actually use all of our scenario tools, especially color. So, here's an example of a Leko. And I'm going to look at our actual source file for the Leko, which I built in Adobe Illustrator. Um, so what we actually imported is an SVG, but this is in AI, the source file. And what you should notice here first is the scale. So we have 1 foot equals 48 pixels, 1 meter equals 160 pixels. That's the same scale just expressed in two different ways. And we make sure that we make it that size. So you can see this is 70 pixels wide total, but actually only 50 of those are um the fixture itself. You can see the the handles for the leaves there. And isund something 116 tall. Again, only uh 96 of those are the actual fixture. And you can see that the primary stroke lines here are two pixels wide. That's just what we chose uh looks best. You can make those whatever you want, but if you want it to match what we use in scenario, it's two pixels. Um, now this is a number of paths uh because that's how SVGs work. But you can see we've separated into three main layers. The top layer is called bounds. And bounds only contains one thing, this empty rectangle. You can see the rectangle there. It goes all the way around the edge. It's exactly at the border of where we want the border to be. And it has no stroke and no fill. You can't see that on. Yeah, you can. No stroke and no fill. It's just there to define the total size. This is where like the selection brackets will show up and where arrows when pointing this arrows will stop at the edge of that. So that's what makes it look nice. So then we have the stroke layer and you see the stroke layer contains everything that is a line basically and I made them black because that's what it is by default. You can actually make them whatever you want. Um but I recommend at least making them all the same color. um or if you don't then uh just don't change the color because it will override that. So we'll do that. And then you can see if we hide this, we're left with what's called the fill layer. So the fill layer is usually all the same as the stroke. It should be all the same as the stroke, but it doesn't have a stroke color. It only has this white fill color. And again, we make it white by default. And then you can change it in scenario if you've labeled these correctly. Um, but you can actually make it anything you want. So those are the three layers that you need. And if you set those up correctly, then what you end up with is a So this is the SVG from that source file. Um, and you can see that I can change the stroke color as you would expect. I can change the fill color as you would expect. I'm just going to zoom in on this so we can see that a little better. But this is not our built-in one. This is actually a custom item that I created from one of our uh preferred SVGs. So, there's one more thing that you need to make sure you do when you export this SVG. I'm going to go file. So, I'm going to go to save as in order to make this an SVG because you can see it's an AI Adobe Illustrator file right now. And you're going to switch it to SVG and save it. And when you save, what's important is to set it up this way. You don't want to preserve um Illustrator editing capabilities. And what you want to do is when you check the SVG code, you want to make sure that the styles are all quote unquote in line. There shouldn't be like a header tag up here that contains any styles. You should be able to see that when you're looking at uh when you're looking at the code, you see the polygon style, the fill is here. So, you should be able to look inside like the polygon tags or the rectangle tags and have fill. And if you go down farther, you'll see the stroke is actually contained within try to find an example here. Anyway, if you see the fill is within the the polygon and it's the style tag there, then that is an indicator that it is working the way it should be. You don't want to have it all up at the top because then we won't be able to change the color. It'll still show up, but you won't be able to change the color. It's called inline style. So, that's what you need to do uh in order to get these to work properly. And again, can't wait to see what you come up with.
Orientation: the top of the image is the front of the fixture
Scale: 1 foot = 48px, 1 meter = 160px
Stroke width = 2px for “primary” lines
10px padding around the edge of the fixture
To use Scenario’s color controls, label SVG layers as:
bounds→ contains only a rectangle (with NO stroke or fill color) drawn at the full-size border of the fixture, including the 10px paddingstroke→ includes all paths that have a “stroke” for lines; ideally blackfill→ includes the “background” layer for the inside of the item; ideally white
Was this helpful?
Still need help? Share an idea