[BUG-11342] Perspective - Can't draw any shapes

Build 8.0.0-beta0 (b2018110708)

Perspective Module. I can’t seem to draw any basic shapes in a View (rectangle, circle, line, etc). I select a shape tool and clicking and dragging on the View just seems to draw a selection box to select other objects on the screen.

1 Like

Those drawing tools are only for use in Vision. You probably have that toolbar due to resetting your panels, which then places all the toolbars on your designer regardless of the context you are in. This is a bug we are aware of. Navigating to Vision in your designer and then back to Perspective should get rid of it as well as any other toolbars that don’t work in Perspective.

1 Like

Ah, that worked going from Vision back to Perspective, thanks.

Are there shape drawing tools in Perspective? I can’t seem to find anything

There aren’t any at the moment. The closest you’d get is using the image or icon component for any sort of graphics along those lines.

There’s the ‘drawing’ container. You can drag svgs into the view and it will make a drawing component, like it would make a group of shapes in Vision. May want to get a vector image program to make whatever you want, then drag & drop the file into the view.

3 Likes

Thanks Michael, I actually use InkScape for the majority of my vector work for SCADA, but it’s easier sometimes for really simple things to just drag on a simple shape in Ignition. But I assume these will be back, just not yet?

Hmm, so I’ve dragged on an SVG into a Perspective View, but I can’t edit it at all. Is this something that is yet to come to Perspective?

Interactive drawing tools will be added to Perspective, absolutely. I doubt they’ll make the initial 8.0 release, however.

That said, support for vector drawings (svg) is in perspective today. You can draw something (in inkscape, for example), save it as an SVG, and then drag it into perspective. You will notice that the properties of the drawing component that is created actually contains all of the SVG paths, transforms, styles, etc. So while it is certainly awkward and inconvenient to do so today (because of the lack of interactive drawing tools), what is exciting about this model is that all of the drawing information is modeled in component properties, meaning that they are fully dynamic and can be manipulated by the binding system.

8 Likes

That’s freaking awesome.

3 Likes

Thats indeed the way to go forward as SVG is platform independent and plugin free! Everything is rendered by the browser! No JVM, no plugins. Amazing! Awesome!

1 Like

Very interesting. I created a line using inkScape and I imported it into Perspective. Now, it is not clear for me how to handle dynamically the endpoints, because I can’t see them in the properties. How do I do it?

It depends on what line was drawn by inkscape. You can open the SVG file with a text editor (notepad or something more readable) to inspect it.

One possibility is that inkscape added a path (https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path), in that case, the line is just encoded as a string, and you can modify that string as a whole, but it’s quite hard to parse a generic path to get out the end points.

The other possibility is that inkscape added a line object (https://developer.mozilla.org/en-US/docs/Web/SVG/Element/line), in which case the endpoints are simply encoded as (x1,y1), (x2, y2), which should be very easy to modify.

In any case, it’s possible to write SVG files by hand. F.e. the SVG below is a line from the top left corner (0,0) to the bottom right corner (100%, 100%), and it will scale to whatever size you want in Ignition (can even be used for horizontal and vertical lines.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   width="20"
   height="20"
   viewBox="0 0 100% 100%"
   id="svg2"
   version="1.1">
    <line
       style="stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       x1="0"
       x2="100%"
       y1="0"
       y2="100%" />
</svg>
2 Likes

Hello Inductive Automation,

Can someone give an update about the possibility to add drawing tools in Perspective?

I am an Ignition fanboy since 7.9.3 and a new Perspective addict. But I cannot understand why we cannot draw free shapes in Perspective.

Thanks.

Work on drawing tools will begin soon-ish, after piping support for Perspective is finished.

1 Like

Not to downplay any exciting development that the IA team has planned for the future, but is there a reason you couldn’t just create SVGs in a vector editing program and drop them into your views? I have run into very few instances where going this route would prevent me from accomplishing something that the drawing tools in Vision would have allowed.

1 Like