DriveWorks Pro 18: Draw Lines In New Image [send feedback...]

Draw Lines In New Image

This Specification Macro Task will draw lines in a new image.

Properties

Property NameDescription
TitleChanges the Title (not the name) of the task.
DestinationThe Full File Path and Name of the image file to create, including its extension.
Constant NameThe name of the Constant used to report on the success of the Task. If it is a success this will be used to store the Path of the generated image.
OverwriteTRUE to overwrite an existing image, FALSE to keep the existing image.
WidthThe new width of the image in pixels.
HeightThe new height of the image in pixels.
An Array Of LinesA Table of lines (start and end points, color, line weight and styles).
Texture FileTexture file used to infill the lines (sketch must be closed to apply).
Background Texture FileBackground texture file. If left blank the background will be transparent.
Line Data Has HeadersTRUE to ignore the first data row, FALSE to include it.

An Array Of Lines

This property requires a Table Array with the different parameters for information about the line(s) to create. The information required relies on specific formatting. The Table items are:

Table ItemDescription
Start XThis is the start X coordinate.
Start YThis is the start Y coordinate.
End XThis is the end X coordinate.
End YThis is the end Y coordinate.
ColorThis is the color of the lines to be created.
Style'Dashes' or 'Dots'. Use any other value, including leaving blank for a solid line.
Line weightThe thickness of the line(s) in pixels.

Example

When this Task is added the properties are static. To be able to build rules on a static properties see How To: Change A Static Property To A Dynamic Property.

Property NameExample RuleExample ResultMeaning
DestinationFsGetFullPath("<Specification>\LinesAddedWorldGraphic.png")C:\MyDocuments\Projects\Specifications\Spec 9999\LinesAddedWorldGraphic.pngThis is the location where the new file will be created.
Constant Name"DWConstantReport"DWConstantReportThis is the name of the Constant that the Task will report to.
OverwriteTRUETRUETRUE will overwrite the file if it exists FALSE will not.
Width600600This is the width of the new image that will be created.
Height450450This is the height of the new image that will be created.
An Array Of LinesDwLookupAnArrayOfLinesDwLookupAnArrayOfLinesThis is a Simple Table containing the data needed to create the different lines.
Texture File"C:\MyDocuments\Content\WhiteBlank.PNG"C:\MyDocuments\Content\WhiteBlank.PNGThis is the file to use as the background if the lines are closed into a polygon. Leaving this blank will make the fill transparent so the background will be shown.
Background Texture File"C:\MyDocuments\Content\Images\MyPicture.png"C:\MyDocuments\Content\Images\MyPicture.pngThis is the file that will be used to create the background of the new image.
Line Data Has HeadersTRUETRUETRUE will ignore the Headers in your Points Of The Line(s) Table. Use FALSE for Tables with no headers.

Example Array

Start XStart YEnd XEnd YColorStyleLine Weight
100100150150#f70018Dot4
200100300400#0014f78

Using the Task in a Specification Macro

This task has different types of Outputs. For more information about Outputs see Specification Macros Task Node.

Outputs are only available within Specification Macros. Currently Outputs are not available for Specification Flow.

Status Outputs

This task supports Status Outputs. These can be used to perform different actions depending on what the status outcome of the task is. For more information see Status Outputs in the Task Node Outputs section of Specification Macros Task Node.

The status output navigation is as follows:

Success

  • The image 'C:\Data\IPPTestImage\Destination\WorldImagepngAfterDrawingLines.png' has been created.

Success with Warnings

  • Should never be fulfilled.

Failed

  • Incoming table must have at least 2 columns.
  • There needs to be at least 2 points to draw a line.
  • Array of Lines must be DriveWorks table.
  • No valid points were found to draw a line.
  • A problem occurred whilst processing the image 'The destination file (C:\Data\IPPTestImage\Destination\WorldImagepngAfterDrawingLines.png) Unable to process the image. No destination file was specified.
  • Unable to process the image. Destination file C:\Data\IPPTestImage\Destination\26%&%$%£"$"£$"%(*&).png contains invalid characters.
  • The file path C:\Data\IPPTestImage\Destination\26%&%$%£"$"£$"%(&)%&%$%£"$"£$"%(&).%&%$%£"$"£$"%(&%$%£"$"£$"%(&).%&%$%£"$"£$"%(&&).%&%$%£"$"£$"%(&).png is too long.
  • An unexpected error occurred processing the image. C:\Data\IPPTestImage\Destination\2623.png

See the Image PowerPack page for further Tasks.

Table of Contents