Learn how to create your own custom objects in Point of View from AutomationDirect.com.
Point of View has hundreds of objects ready for you to use right now. Even so, there will be times when you just want to create your own objects. In this video we’ll make custom button to control lighting and a door lock for an oddly shaped room in a facility. Let’s delete room 105 and re-create it from scratch. I’ll also delete the associated tags so you can see how we create those too. First we’ll go to the graphics tab and select a closed polygon. Click on a point to start and then click on each corner. Double click to finish. This is just a dumb polygon. If we double click on it you can see, all we can do is change the border and fill. To make it do something click on the polygon and enable the features – or “animations” you want it to have. For this example we want to be able to click on it with a mouse – or “command it” so we click that one. And we want to be able to change the color of it so we click that one. Now if we double click on the polygon we see we have the original polygon AND the command and color animations available to us. One of the cool things about point of view is you don’t have to close dialog boxes to do things. For example, suppose we didn’t want the color animation. Well, Just click it to de-select it and that option is now gone. Click it to add it back in and there it is. I love that I don’t have to keep exiting and re-starting dialogs every time I want to do something … So, we want to be able to click on this polygon and change its color. So let’s go to the command dialog and say we want the down stroke of a mouse button to toggle a tag. And that Tag will be the Office105_Lights tag. Point of View reminds us this is a new tag and asks if we want to create it – we do. And we want that to be a Boolean that just turns on and off. Now we switch to the color dialog and have the colors change on that same tag. When the Office105_Lights tag – which we’ll grab from the tag database to save typing - is a zero we want the color to be dark gray and when it’s a one we’ll make it yellow. So now we can click on the polygon to change the lights tag and that tag is used to change the color of the polygon to tell us the lights are on in that room. We need to do one more thing. If you look at the polygon you can see it has no fill – we can see right through it to the grid. So we need to go to the polygons dialog and enable fill so our new colors will show up. Let’s try it. Save the screen and hit run. Perfect – we can turn the lights on and off. But what is this outline here. That’s annoying, so let’s turn that off. In the command dialog, hit config. This enable focus check box is the issue. That check box says highlight which object has focus right now in the app. That’s important if you want to be able to tab through objects and know which one you are currently on, but our example doesn’t need that so we’ll turn it off. Save it, Try it. And sure enough that annoying focus box is gone. Now let’s add the door. Same thing except this time we’ll use a line graphic as our base object. I’ll draw it out where I can see it. Double click on it to get it’s properties and change the width to 6 so we can see it and move it to the office. Once again we have a dumb object that doesn’t do anything. So we click on it and then enable the properties we want. We want it to be command-able, to change color and let’s have this one rotate to look like it is opening. Notice that the dialog I left open automatically changed to the new object – again I love that I don’t have to keep opening and closing dialogs. Starting with the command, we want to toggle Door 105’s lock. Point of View asks if we want to create that tag, we do and we want it to be another Boolean. Great, so when we click on this door, it will toggle this tag. When that happens we want the color to change from red to green – which it is already setup to do and we want it to do it on the door 105 tag. Finally, we want the door to rotate about the topright corner. The range is the 0 to 1 of the Boolean tag and the rotation should be from the current 0 position to a position 40 degrees clockwise. And we want that to also respond to the Door 105 tag. Let’s try it. Save. Run. And sure enough the door opens and closes and changes color. But we have that annoying focus box again, so go back to the command dialog, hit config, turn off focus, and hit OK. Save. Run. And there we go – we can now turn the lights on and off and lock and unlock the door. Perfect. Let’s do one more thing. Let’s make the door blink when it is unlocked. That’s easy. Go back to colors, and enable slow blinking. Save run, try it. Now when the door is left unlocked, it blinks. So to create any object in point of view, you just drop a generic object on the screen, enable the animations you want and configure them. Once you understand this basic flow and see just how much power and flexibility and freedom Point of View gives you to do what you want, well .. you’re only limited by your imagination. It’s awesome. Check out the other videos in this series to get even more ideas and to learn more about Point of Views capabilities. And as always, if you have any questions, please don’t hesitate to contact AutomationDirect’s free, award winning tech support during regular business hours. They will be happy to help you. And don’t forget the forums – there are lots of folks there that love to share their years of experience. Just don’t post and support questions on the forums, AutomationDirect’s support staff doesn’t monitor the forums on a regular basis.