This function will shutdown the application and exit. All open drawings
will be closed before exiting. If any drawings have been changed, you will
be prompted to save them before exiting.
TCWAppExit
This function will return the active window handle. The active window is
the currently active drawing window.
Dim hWindow As Long
hWindow = TCWActiveWindow()
...
This function will launch an Enable Basic statement (passed as a String)
or load and execute an Enable basic file (if the string ends with ".bas").
String script | A statement in Enable Basic or the name of an Enable Basic file | |
TCWBasicRun "MsgBox" + Chr(34) + "Hello World!" + Chr(34)
TCWBasicRun "test.bas"
This function will launch the Enable debugger with an Enable Basic statement
(passed as a String) or load an Enable basic file (if the string ends with ".bas") into
the debugger.
String script | A statement in Enable Basic or the name of an Enable Basic file | |
TCWBasicDebug "MsgBox" + Chr(34) + "Hello World!" + Chr(34)
TCWBasicDebug "test.bas"
This function will return a string for the last error that occurred in the script.
The script is responsible for checking for errors after making TCADAPI calls.
If the API call was supposed to return a handle to drawing, graphic, ...
you should check for NULL and call TCWLastErrorGet if true. If a non-null handle
was returned, then the call succeeded and you don't need to check for errors.
For Api calls that return status, 0 signifies success. Non-zero status signifies failure
and you should call TCWLastErrorGet to get the error text.
String errorstring | Buffer to return error string in | |
Dim result As Long
Dim errtext As String
Dim gCircle As Long
...
gCircle = TCWCircleCenterAndPoint(xc, yc, zc, xp, yp, zp)
if (gCircle = NULL) then
result = TCWLastErrorGet (errtext)
MsgBox errtext
'Terminate the program
Stop
end if
...
This function will clear the error info in TCADAPI. You can use this function after
you've checked the previous TCADAPI function status. TCADAPI will clear
the error information structure at the beginning of each API function so previous
errors will be lost if you don't use TCWLastErrorGet.
...
TCWClearError
This function will return the value of the property that has been
requested. This function is written in Basic due to problems with Enable
not supporting Variants with DLLs.
String propertyname | name of property look up | |
AVAILABLE PROPERTIES: | DESCRIPTION: | |
"ColorButtons" | buttons are color or black and white | |
"EditBar" | viewing of the EditBar | |
"LargeButtons" | buttons are large or small | |
"Organization" | organization name | |
"OpenReadOnly" | open files as read only | |
"PromptForSummaryInfo" prompting | for summary information on save | |
"Rulers" | viewing of Rulers | |
"ScrollBars" | viewing of Scroll Bars | |
"StatusBar" | viewing of Status Bar | |
"ShowTooltips" | show tool tips | |
"SaveDesktopOnExit" | save desktop settings on exit | |
"UserName" | username | |
"ZoomFactor" | what factor to zoom when zooming in/out | |
AVAILABLE PROPERTIES: | VALUE RETURNED: | |
"ColorButtons" | -1 if color buttons set, 0 if not set | |
"EditBar" | -1 if displayed, 0 if not displayed | |
"LargeButtons" | -1 large buttons is set, 0 if not set | |
"Organization" | organization name as a string | |
"OpenReadOnly" | -1 if set, 0 if not set | |
"PromptForSummaryInfo" -1 | if set, 0 if not set | |
"Rulers" | -1 if displayed, 0 if not displayed | |
"ScrollBars" | -1 if displayed, 0 if not displayed | |
"StatusBar" | -1 if displayed, 0 if not displayed | |
"ShowTooltips" | -1 if displayed, 0 if not displayed | |
"SaveDesktopOnExit" | -1 if set, 0 if not set | |
"UserName" | username as a string | |
"ZoomFactor" | the zoom factor as a double | |
This function will set the property with the specified value.
String propertyname | name of property to modify | |
Variant value | value to set to | |
AVAILABLE PROPERTIES: | VALUE: | |
"ColorButtons" | 1 if color, 0 if black and white (Integer) | |
"EditBar" | 1 if displayed, 0 if not displayed (Integer) | |
"LargeButtons" | 1 if large buttons, 0 if small (Integer) | |
"Organization" | organization name (String) | |
"OpenReadOnly" | 1 if read only, 0 if not (Integer) | |
"PromptForSummaryInfo" 1 | if prompt, 0 if no prompt (Integer) | |
"Rulers" | 1 if displayed, 0 if not (Integer) | |
"ScrollBars" | 1 if displayed, 0 if not (Integer) | |
"StatusBar" | 1 if displayed, 0 if not (Integer) | |
"ShowTooltips" | 1 if show tips, 0 if not (Integer) | |
"SaveDesktopOnExit" | 1 if save on exit, 0 if not (Integer) | |
"UserName" | username (String) | |
"ZoomFactor" | zoom factor (Double) | |
This function will create a new TurboCAD drawing.
Dim hDrawing As Long
hDrawing = TCWDrawingNew()
if (hDrawing = NULL) then
...
end if
...
This function will open a drawing in any TurboCAD supported format. The format
is based on the file extension (.tcw, .dxf, .dwg...).
String drawingname | name of drawing to open | |
Dim hDrawing As Long
hDrawing = TCWDrawingOpen("c:\mydrawings\pipes.tcw")
if (hDrawing = NULL) then
'check error
...
This function will close the current drawing. If the file has changed since
it was last saved, the value of savechanges will determine if the file is saved
first before closing.
Long savechanges | 1 if save changes before closing, 0 to not save changes | |
...
result = TCWDrawingClose(1)
if (result <> 0) then
'check error
...
This function will save the current drawing to disk using the file and folder
name that was previously used. If this is the first time the file has been
saved, you will be prompted with the SaveAs dialog, prompting you for a name
and location to save the file. If you have Prompt for Summary Info in the
Options|Program Setup|General property sheet selected, you will be prompted to
input summary information.
...
result = TCWDrawingSave()
if (result <> 0)
'check error
...
This function will save the current drawing to disk using a file name and folder
you specify. The SaveAs dialog box will be displayed and you can input name,
location, etc. If you have Prompt for Summary Info in the
Options|Program Setup|General property sheet selected, you will be prompted to
input summary information.
String drawingname | new name of drawing | |
...
result = TCWDrawingSaveAs("newdrawing.tcw")
if (result <> 0) then
'check error
...
This function will return the name of the drawing associated with the active
drawing. If the drawing is a new drawing that has not been saved, this function
will return the drawing title (e.g. Drawing1). This function can be used with TCWDrawingAt and TCWDrawingCount.
If you have only one drawing open, you can use TCWDrawingName(name) and it will
return the name of the current drawing. If you have multiple drawings open,
use TCWDrawingCount to find out how many are open, then use TCWDrawingAt and TCWDrawingName
to cycle through the drawings to get the name of each.
String drawingname | buffer for drawing name | |
Dim dCount As Long
Dim hDrawing As Long
Dim i As Long
Dim dName As String
dCount = TCWDrawingCount()
if (dCount = 0) then
MsgBox "No drawings open."
Stop
end if
for i = 1 to dCount
hDrawing = TCWDrawingAt(i)
TCWDrawingName dName
MsgBox dName
next i
...
This function will activate the drawing specified. This function is used
with TCWDrawingCount to get the number of drawings open in the application.
If you have multiple drawings open, you can use TCWDrawingCount to get the
number of drawings, then use TCWDrawingAt to change the active drawing.
Long index | number associated with the open drawing | |
Dim dCount As Long
Dim i As Long
Dim hDrawing As Long
dCount = TCWDrawingCount()
for i = 1 to dCount
hDrawing = TCWDrawingAt(i)
...
next i
...
This function will return the number of open drawings. Used with
TCWDrawingName and TCWDrawingAt to cycle through the open drawings.
Dim dCount As Long
Dim i As Long
Dim hDrawing As Long
dCount = TCWDrawingCount()
for i = 1 to dCount
hDrawing = TCWDrawingAt(i)
...
next i
...
This function will print the current drawing. Set showdialog to TRUE if
you want to see the print dialog box and have access to the page setup
parameters.
Long showdialog | 1 to show print dialog box, 0 if no print dialog box | |
...
result = TCWDrawingPrint(0)
...
This function will return the handle of the active drawing.
Dim hDrawing As Long
hDrawing = TCWDrawingActive()
if (hDrawing = NULL) then
Msgbox "No active drawing".
...
This function will delete all the undo records in the current drawing. You will
not be able to Redo any previous actions after making this call.
...
result = TCWUndoClear()
...
This function will reverse the last n changes in the current drawing.
long n | number of changes to undo | |
...
result = TCWUndo(2) 'undo last 2 operations
This function will reverse the effect of the last undo.
...
result = TCWRedo() 'oops - get it back!
This function selects the all graphics in the drawing.
...
result = TCWSelectAll()
if (result = 0) then
'change all graphics to have PenColor Red
...
This function will deselect all selected graphics.
...
result = TCWDeselectAll()
...
This function will delete all selected graphics.
select all graphics with type = circle
TCWSelectByQuery("type = circle")
result = TCWClearSelection()
...
This function will delete all graphics in the current drawing.
This deletes every graphic, not just what is selected. To only delete
selected graphics, see TCWClearSelection.
...
result = TCWClearAll()
...
This function will delete all construction graphics in the current drawing.
...
TCWClearAllConstructions()
...
This function will draw a construction line at the specified angle.
Double x0 | X coordinate of the first point | |
Double y0 | Y coordinate of the first point | |
Double z0 | Z coordinate of the first point | |
Double x1 | X coordinate of the second point | |
Double y1 | Y coordinate of the second point | |
Double z1 | Z coordinate of the second point | |
Dim hConstr As Long
...
hConstr = TCWConstructionAngularLine(x1, y1, z1, x2, y2, z2)
if (hConstr = NULL) then
'check error
...
This function will draw a horizontal construction line.
Double x0 | X coordinate of point on the line | |
Double y0 | Y coordinate of point on the line | |
Double z0 | Z coordinate of point on the line | |
Dim hConstr As Long
Dim xc As Double
Dim yc As Double
'get center of view for construction line placement
xc = (TCWViewExtentsGetX1() + TCWViewExtentsGetX2())/2
yc = (TCWViewExtentsGetY1() + TCWViewExtentsGetY2())/2
hConstr = TCWConstructionHorizontalLine(xc, yc, 0.0)
if (hConstr = NULL) then
'check error
...
This function will draw a vertical construction line.
Double x0 | X coordinate of point on the line | |
Double y0 | Y coordinate of point on the line | |
Double z0 | Z coordinate of point on the line | |
Dim hConstr As Long
Dim xc As Double
Dim yc As Double
'get center of view for construction line placement
xc = (TCWViewExtentsGetX1() + TCWViewExtentsGetX2())/2
yc = (TCWViewExtentsGetY1() + TCWViewExtentsGetY2())/2
hConstr = TCWConstructionVerticalLine(xc, yc, 0.0)
if (hConstr = NULL) then
'check error
...
This function will draw a construction circle defined by its centerpoint
and a point on its perimeter.
Double x0 | X coordinate of the center point | |
Double y0 | Y coordinate of the center point | |
Double z0 | Z coordinate of the center point | |
Double x1 | X coordinate of the perimeter point | |
Double y1 | Y coordinate of the perimeter point | |
Double z1 | Z coordinate of the perimeter point | |
This function will draw a construction circle that passes through two defined
points 180 degrees apart.
Double x0 | X coordinate of the first point | |
Double y0 | Y coordinate of the first point | |
Double z0 | Z coordinate of the first point | |
Double x1 | X coordinate of the second point | |
Double y1 | Y coordinate of the second point | |
Double z1 | Z coordinate of the second point | |
This function will draw a construction circle that passes through three
defined points.
Double x0 | X coordinate of the first point | |
Double y0 | Y coordinate of the first point | |
Double z0 | Z coordinate of the first point | |
Double x1 | X coordinate of the second point | |
Double y1 | Y coordinate of the second point | |
Double z1 | Z coordinate of the second point | |
Double x2 | X coordinate of the third point | |
Double y2 | Y coordinate of the third point | |
Double z2 | Z coordinate of the third point | |
This function will create a point that is a "dot".
Double x0 | X coordinate for the point | |
Double y0 | Y coordinate for the point | |
Double z0 | Z coordinate for the point | |
Dim hGraphic As Long
hGraphic = TCWDot(2.0, 3.0, 0.0)
if (hGraphic = NULL)
'check error
...
This function will create a point that is a "star".
Double x0 | X coordinate for the point | |
Double y0 | Y coordinate for the point | |
Double z0 | Z coordinate for the point | |
Dim hGraphic As Long
hGraphic = TCWStar(2.0, 3.0, 0.0)
if (hGraphic = NULL)
'check error
...
This function will create a point that is a "square".
Double x0 | X coordinate for the point | |
Double y0 | Y coordinate for the point | |
Double z0 | Z coordinate for the point | |
Dim hGraphic As Long
hGraphic = TCWSquare(2.0, 3.0, 0.0)
if (hGraphic = NULL)
'check error
...
This function will create a point that is a "cross".
Double x0 | X coordinate for the point | |
Double y0 | Y coordinate for the point | |
Double z0 | Z coordinate for the point | |
Dim hGraphic As Long
hGraphic = TCWCross(2.0, 3.0, 0.0)
if (hGraphic = NULL)
'check error
...
This function will create a point that is a "circle".
Double x0 | X coordinate for the point | |
Double y0 | Y coordinate for the point | |
Double z0 | Z coordinate for the point | |
Dim hGraphic As Long
hGraphic = TCWCircle(2.0, 3.0, 0.0)
if (hGraphic = NULL)
'check error
...
This function will draw a single line segment from two specified end points.
Double x0 | X coordinate for the first point | |
Double y0 | Y coordinate for the first point | |
Double z0 | Z coordinate for the first point | |
Double x1 | X coordinate for the second point | |
Double y1 | Y coordinate for the second point | |
Double z1 | Z coordinate for the second point | |
This function will draw a regular polygon with the specified number
of sides.
Double x0 | X coordinate for the center point | |
Double y0 | Y coordinate for the center point | |
Double z0 | Z coordinate for the center point | |
Double x1 | X coordinate for the corner point | |
Double y1 | Y coordinate for the corner point | |
Double z1 | Z coordinate for the corner point | |
Long nsides | number of sides | |
This function will draw an orthogonal rectangle.
Double x0 | X coordinate of the upper left corner | |
Double y0 | Y coordinate of the upper left corner | |
Double z0 | Z coordinate of the upper left corner | |
Double x1 | X coordinate of the lower right corner | |
Double y1 | Y coorindate of the lower right corner | |
Double z1 | Z coorindate of the lower right corner | |
This function will draw a rectangle oriented at the specified angle.
Double x0 | X coordinate of the upper left corner | |
Double y0 | Y coordinate of the upper left corner | |
Double z0 | Z coordinate of the upper left corner | |
Double x1 | X coordinate of the lower right corner | |
Double y1 | Y coorindate of the lower right corner | |
Double z1 | Z coorindate of the lower right corner | |
Double height | angle of rotation in radians | |
This function will draw a line perpendicular to an existing line.
Long g | handle of line to make new line perpendicular to | |
Double x0 | X coordinate of the point on the existing line | |
Double y0 | Y coordinate of the point on the existing line | |
Double z0 | Z coordinate of the point on the existing line | |
This function will draw a line parallel to an existing line, at a
specified distance from the line.
Long g | handle of line to make new line parallel to | |
Double x0 | X coordinate of the new line | |
Double y0 | Y coordinate of the new line | |
Double z0 | Z coordinate of the new line | |
This function will start the creation of a series of connected segments.
Use TCWGraphicXYZAdd or TCWGraphicVertexAdd to define the next segment.
Use TCWGraphicClose to close the multi-line into a polygon.
Double x0 | X coordinate of first end point | |
Double y0 | Y coordinate of first end point | |
Double z0 | Z coordinate of first end point | |
This function will start the creation of an irregular polygon.
Use TCWGraphicXYZAdd or TCWGraphicVertexAdd to define the next point of the polygon.
Use TCWGraphicClose to close the multi-line into the polygon.
Double x0 | X coordinate of first end point | |
Double y0 | Y coordinate of first end point | |
Double z0 | Z coordinate of first end point | |
This function will start the creation of a series of connected double lines.
Use TCWGraphicXYZAdd or TCWGraphicVertexAdd to define the next point of the segment.
Use TCWGraphicClose to close the multi-double line into a polygon.
Double x0 | X coordinate of first end point | |
Double y0 | Y coordinate of first end point | |
Double z0 | Z coordinate of first end point | |
This function will start the creation of a double line polygon with an
arbitrary number of sides.
Use TCWGraphicXYZAdd or TCWGraphicVertexAdd to define the next segment.
Use TCWGraphicClose to close the multi-line into a polygon.
Double x0 | X coordinate of first end point | |
Double y0 | Y coordinate of first end point | |
Double z0 | Z coordinate of first end point | |
This function will start the creation of a bezier curve, connecting
two end points that will gravitate toward control points along the path.
Use TCWGraphicClose to close the bezier curve, matching the last end point
with the first end point.
Double x0 | X coordinate of the first end point | |
Double y0 | Y coordinate of the first end point | |
Double z0 | Z coordinate of the first end point | |
This function will start the creation of a spline curve, connecting
a series of points into a continuous curve.
Use TCWGraphicClose to close the spline curve, matching the last end point
with the first end point.
Double x0 | X coordinate of the first end point | |
Double y0 | Y coordinate of the first end point | |
Double z0 | Z coordinate of the first end point | |
This function will draw a double line segment from two specified end points.
Double x0 | X coordinate for the first point | |
Double y0 | Y coordinate for the first point | |
Double z0 | Z coordinate for the first point | |
Double x1 | X coordinate for the second point | |
Double y1 | Y coordinate for the second point | |
Double z1 | Z coordinate for the second point | |
This function will draw a regular double line polygon with the specified
number of sides.
Double x0 | X coordinate for the center point | |
Double y0 | Y coordinate for the center point | |
Double z0 | Z coordinate for the center point | |
Double x1 | X coordinate for the corner point | |
Double y1 | Y coordinate for the corner point | |
Double z1 | Z coordinate for the corner point | |
Long nsides | number of sides | |
This function will draw an orthogonal double line rectangle.
Double x0 | X coordinate of the upper left corner | |
Double y0 | Y coordinate of the upper left corner | |
Double z0 | Z coordinate of the upper left corner | |
Double x1 | X coordinate of the lower right corner | |
Double y1 | Y coorindate of the lower right corner | |
Double z1 | Z coorindate of the lower right corner | |
This function will draw a double line rectangle oriented at the specified angle.
Double x0 | X coordinate of the upper left corner | |
Double y0 | Y coordinate of the upper left corner | |
Double z0 | Z coordinate of the upper left corner | |
Double x1 | X coordinate of the lower right corner | |
Double y1 | Y coorindate of the lower right corner | |
Double z1 | Z coorindate of the lower right corner | |
Double height | angle of rotation in radians | |
This function will draw a double line perpendicular to an existing line.
Long g | handle of line to make new line perpendicular to | |
Double x0 | X coordinate of the point on the existing line | |
Double y0 | Y coordinate of the point on the existing line | |
Double z0 | Z coordinate of the point on the existing line | |
Double x1 | X coordinate of the second point on the new line | |
Double y1 | Y coordinate of the second point on the new line | |
Double z1 | Z coordinate of the second point on the new line | |
This function will draw a double line parallel to an existing line, at a
specified distance from the line.
Long g | handle of line to make new line parallel to | |
Double x0 | X coordinate of the new line | |
Double y0 | Y coordinate of the new line | |
Double z0 | Z coordinate of the new line | |
This function will draw a circle from the specified center point and radius.
Double x0 | X coordinate of the center point | |
Double y0 | Y coordinate of the center point | |
Double z0 | Z coordinate of the center point | |
Double x1 | X coordinate of the radius point | |
Double y1 | Y coordinate of the radius point | |
Double z1 | Z coordinate of the radius point | |
This function will draw a circle using two opposite points on its perimeter.
Double x0 | X coordinate of the first point | |
Double y0 | Y coordinate of the first point | |
Double z0 | Z coordinate of the first point | |
Double x1 | X coordinate of the second point | |
Double y1 | Y coordinate of the second point | |
Double z1 | Z coordinate of the second point | |
This function will draw an ellipse by defining its bounding rectangle.
Double x0 | X coordinate of bounding rectangle's upper left corner | |
Double y0 | Y coordinate of bounding rectangle's upper left corner | |
Double z0 | Z coordinate of bounding rectangle's upper left corner | |
Double x1 | X coordinate of bounding rectangle's lower right corner | |
Double y1 | Y coordinate of bounding rectangle's lower right corner | |
Double z1 | Z coordinate of bounding rectangle's lower right corner | |
This function will draw an ellipse rotated by specifying the ellipse's
center point, and major and minor axis radius points.
Double x0 | X coordinate of ellipse's center point | |
Double y0 | Y coordinate of ellipse's center point | |
Double z0 | Z coordinate of ellipse's center point | |
Double x1 | X coordinate of major axis radius point | |
Double y1 | Y coordinate of major axis radius point | |
Double z1 | Z coordinate of major axis radius point | |
Double x2 | X coordinate of minor axis radius point | |
Double y2 | Y coordinate of minor axis radius point | |
Double z2 | Z coordinate of minor axis radius point | |
This function will draw an ellipse, specified by the ratio of the
major axis length to the minor axis length.
Double x0 | X coordinate of ellipse's center point | |
Double y0 | Y coordinate of ellipse's center point | |
Double z0 | Z coordinate of ellipse's center point | |
Double x1 | X coordinate of radius in Y direction | |
Double y1 | Y coordinate of radius in Y direction | |
Double z1 | Z coordinate of radius in Y direction | |
Double xyratio | ratio of Rx/Ry | |
This function will draw a circular arc specified by it's center point,
point on it's circuference and a start and end angle.
Double x0 | X coordinate of arc's center point | |
Double y0 | Y coordinate of arc's center point | |
Double z0 | Z coordinate of arc's center point | |
Double x1 | X coordinate of the radius point | |
Double y1 | Y coordinate of the radius point | |
Double z1 | Z coordinate of the radius point | |
Double startangle | starting angle in radians | |
Double endangle | ending angle in radians | |
This function will draw a circular arc from specified end points
of its diameter.
Double x0 | X coordinate of first end point | |
Double y0 | Y coordinate of first end point | |
Double z0 | Z coordinate of first end point | |
Double x1 | X coordinate of second end point | |
Double y1 | Y coordinate of second endpont | |
Double z1 | Z coordinate of second end point | |
Double startangle | starting angle in radians | |
Double endangle | ending angle in radians | |
This function will draw a circular arc by defining (1) its starting
point, (2) a point on its perimeter and (3) its ending point.
Double x0 | X coordinate of starting point | |
Double y0 | Y coordinate of starting point | |
Double z0 | Z coordinate of starting point | |
Double x1 | X coordinate of point on perimeter | |
Double y1 | Y coordinate of point on perimeter | |
Double z1 | Z coordinate of point on perimeter | |
Double x2 | X coordinate of ending point | |
Double y2 | Y coordinate of ending point | |
Double z2 | Z coordinate of ending point | |
This function will draw an elliptical arc specified by its bounding
rectangle, starting and ending angles.
Double x0 | X coordinate of bounding rectangle's upper left corner | |
Double y0 | Y coordinate of bounding rectangle's upper left corner | |
Double z0 | Z coordinate of bounding rectangle's upper left corner | |
Double x1 | X coordinate of bounding rectangle's lower right corner | |
Double y1 | Y coordinate of bounding rectangle's lower right corner | |
Double z1 | Z coordinate of bounding rectangle's lower right corner | |
Double startangle | starting angle in radians | |
Double endangle | ending angle in radians | |
This function will draw an elliptical arc rotated by specifying the ellipse's
center point, and major and minor axis radius points, start and end angles.
Double x0 | X coordinate of elliptical arc's center point | |
Double y0 | Y coordinate of elliptical arc's center point | |
Double z0 | Z coordinate of elliptical arc's center point | |
Double x1 | X coordinate of major axis radius point | |
Double y1 | Y coordinate of major axis radius point | |
Double z1 | Z coordinate of major axis radius point | |
Double x2 | X coordinate of minor axis radius point | |
Double y2 | Y coordinate of minor axis radius point | |
Double z2 | Z coordinate of minor axis radius point | |
Double startangle | starting angle in radians | |
Double endangle | ending angle in radians | |
This function will draw an elliptical arc, specified by the ratio of the
major axis length to the minor axis length.
Double x0 | X coordinate of ellipse's center point | |
Double y0 | Y coordinate of ellipse's center point | |
Double z0 | Z coordinate of ellipse's center point | |
Double x1 | X coordinate of radius in Y direction | |
Double y1 | Y coordinate of radius in Y direction | |
Double z1 | Z coordinate of radius in Y direction | |
Double xyratio | ratio of Rx/Ry | |
Double startangle | starting angle in radians | |
Double endangle | ending angle in radians | |
This function will create text starting at the point specified.
Double x0 | X coordinate of text's starting point | |
Double y0 | Y coordinate of text's starting point | |
Double z0 | Z coordinate of text's starting point | |
String textstr | text string | |
Double size | font size | |
Double angle | angle of text | |
This function will create a linear dimension showing horizontal distance.
Double x0 | X coordinate of first extension line | |
Double y0 | Y coordinate of first extension line | |
Double z0 | Z coordinate of first extension line | |
Double x1 | X coordinate of second extension line | |
Double y1 | Y coordinate of second extension line | |
Double z1 | Z coordinate of second extension line | |
Double x2 | X coordinate of dimension | |
Double y2 | Y coordinate of dimension | |
Double z2 | Z coordinate of dimension | |
This function will create a linear dimension showing horizontal distance.
Long g | entity to horizontally dimension | |
Double x0 | X coordinate for dimension line location | |
Double y0 | Y coordinate for dimension line location | |
Double z0 | Z coordinate for dimension line location | |
This function will create a linear dimension showing vertical distance.
Double x0 | X coordinate of first extension line | |
Double y0 | Y coordinate of first extension line | |
Double z0 | Z coordinate of first extension line | |
Double x1 | X coordinate of second extension line | |
Double y1 | Y coordinate of second extension line | |
Double z1 | Z coordinate of second extension line | |
Double x2 | X coordinate of dimension | |
Double y2 | Y coordinate of dimension | |
Double z2 | Z coordinate of dimension | |
This function will create a linear dimension showing vertical distance.
Long g | entity to vertically dimension | |
Double x0 | X coordinate for dimension line location | |
Double y0 | Y coordinate for dimension line location | |
Double z0 | Z coordinate for dimension line location | |
This function will create a linear dimension showing absolute distance
between two points.
Double x0 | X coordinate of first extension line | |
Double y0 | Y coordinate of first extension line | |
Double z0 | Z coordinate of first extension line | |
Double x1 | X coordinate of second extension line | |
Double y1 | Y coordinate of second extension line | |
Double z1 | Z coordinate of second extension line | |
Double x2 | X coordinate of dimension | |
Double y2 | Y coordinate of dimension | |
Double z2 | Z coordinate of dimension | |
This function will create a linear dimension showing parallel distance.
Long g | entity to dimension | |
Double x0 | X coordinate for dimension line location | |
Double y0 | Y coordinate for dimension line location | |
Double z0 | Z coordinate for dimension line location | |
This function will start an undo record. NOTE: a start record MUST be matched
with an end record.
Long d | handle of a drawing | |
String title | string to associate with undo record | |
This function will add graphics to the undo record. Use this
function to accumulate graphics that you may want to undo.
Long d | handle of a drawing | |
Long g | graphic to add to undo record | |
This function will close an opened undo record.
Long d | handle of a drawing | |
This function will select graphics based on specified criteria. The query
language is defined as follows:
"query" -> "expr"
"expr" -> "expr" OR "expr" | "expr" AND "expr" | ("expr") |
NOT "expr" | "atom"
"atom" -> ALL | SELECTED | "field_name" "relation" "value"
"rel" -> = | <> | < | <= | > | >=
"field_name" -> "string" | "any_string"
"value" -> "string" | "any_string"
"string" -> string without spaces which is not a keyword and doesn't
have any reserved characters
"any_string" -> string without any double quote marks, may have spaces
Keywords for query are:
ALL, SELECTED, OR, AND, NOT
Reserved characters are:
=, <, >, ", (, )
Precedence (in decending order):
()
NOT
AND
OR
String s | string for search | |
An empty | query is equivalent to SELECTED. Use TCWSelectionCount and TCWSelectionAt | |
to cycle | through the selected graphics. | |
Dim hGraphic As Long
'This query adds all elements from the electrical layer to the current selection
hGraphic = TCWSelectByQuery("SELECTED OR Layer = electrical")
if (hGraphic = NULL) then
MsgBox "No graphics met criteria".
Stop
...
This function will return a count of the number of graphics currently
selected.
This function will return the handle of the requested graphic. The index
should be a number from 1 to the value returned by TCWSelectionCount.
Long index | requested select graphic index | |
Will scale the selected graphics in the x, y and z direction. A value of 1.0 in
any parameter will not change the scale.
Double xscale | X scale factor | |
Double yscale | Y scale factor | |
Double zscale | Z scale factor | |
Double x0 | x coordinate of reference point | |
Double y0 | y coordinate of reference point | |
Double z0 | z coordinate of reference point | |
This function will move the selected graphic to the new coordinates.
Double dx | delta x coordinate to move selected graphic | |
Double dy | delta y coordinate to move selected graphic | |
Double dz | delta z coordinate to move selected graphic | |
This function will rotate the selected graphics by the rotation angle
supplied.
String axis | "X", "Y", or "Z" where "X" means rotate in the Y-Z plane | |
Double angle | rotation angle in radians | |
Double x0 | x coordinate of reference point | |
Double y0 | y coordinate of reference point | |
Double z0 | z coordinate of reference point | |
This function will return the handle of a block with the specified
block name.
String blockname | name of block to return | |
This function will create a block from the selected graphics. The block
will be named from the name specified. Normally when you create a block
from selected graphics, the graphics will be removed from the drawing and
the newly created block will be add to the block table. If you want to
keep the original selected graphics around (as separate graphics) then set
the copy parameter to TRUE. If you want to remove the original selected
graphics and have then replaced with the new block then set the blockinsert
parameter to TRUE.
String blockname | string for block name | |
This function will insert a block into the drawing.
String blockname | block name to insert | |
Double x0 | x coordinate for where to insert block | |
Double y0 | y coordinate for where to insert block | |
Double z0 | z coordinate for where to insert block | |
This function will return the value of the property that has been
requested. This function is written in Basic due to problems with Enable
not supporting Variants with DLLs.
String propertyname | name of property look up | |
AVAILABLE PROPERTIES: | DESCRIPTION: | |
"GridType" | tbd | |
"GridStyle" | tbd | |
"GridSpacingX" | tbd | |
"GridSpacingY" | tbd | |
"GridColorMajor" | tbd | |
"GridColorMinor" | tbd | |
"GridShow" | tbd | |
"GridFrequencyX" | tbd | |
"GridFrequencyY" | tbd | |
"GridMinorX" | tbd | |
"GridMinorY" | tbd | |
"GridOriginX" | tbd | |
"GridOriginY" | tbd | |
"GridOriginBase" | tbd | |
"PenColor" | pen color as &H00bbggrr | |
"PenWidth" | pen width as a Double | |
"PenScale" | pen scale as a Double | |
"PenStyle" | pen style as a Integer | |
"BrushColor" | brush color as &H00bbggrr | |
"BrushScale" | brush scale as a Double | |
"BrushAngle" | brush angle as a Double | |
"BrushStyle" | brush style as a Double | |
"TextStyle" | text style as an Integer | |
"ScaleSystem" | scale system as an Integer | |
"BrushDrawMode" | brush drawing mode as n Integer | |
"PenAlignment" | pen alignment as a String | |
"HatchCross" | hatch cross as an Integer | |
"Layer" | layer id as an Integer | |
"Info" | info string as a String | |
"TextFont" | text font as a String | |
"TextFormat" | text format as an Integer | |
"TextSize" | text size as a Double | |
AVAILABLE PROPERTIES: | VALUE RETURNED: | |
"PenColor" | &H00bbggrr (Long) | |
"PenWidth" | (Double) | |
"PenScale" | (Double) | |
"PenStyle" | (Integer) | |
"BrushColor" | &H00bbggrr (Long) | |
"BrushScale" | (Double) | |
"BrushAngle" | (Double) | |
"BrushStyle" | (Double) | |
"TextStyle" | (Integer) | |
"ScaleSystem" | (Integer) | |
"BrushDrawMode" | (Integer) | |
"PenAlignment" | (String) | |
"HatchCross" | (Integer) | |
"Layer" | (Integer) | |
"Info" | (String) | |
"TextFont" | (String) | |
"TextFormat" | (Integer) | |
"TextSize" | (Double) | |
This function will set the property with the specified value.
String propertyname | name of property to modify | |
Variant value | value to set to | |
AVAILABLE PROPERTIES: | DESCRIPTION: | |
"GridType" | tbd | |
"GridStyle" | tbd | |
"GridSpacingX" | tbd | |
"GridSpacingY" | tbd | |
"GridColorMajor" | tbd | |
"GridColorMinor" | tbd | |
"GridShow" | tbd | |
"GridFrequencyX" | tbd | |
"GridFrequencyY" | tbd | |
"GridMinorX" | tbd | |
"GridMinorY" | tbd | |
"GridOriginX" | tbd | |
"GridOriginY" | tbd | |
"GridOriginBase" | tbd | |
"PenColor" | pen color as &H00bbggrr | |
"PenWidth" | pen width as a Double | |
"PenScale" | pen scale as a Double | |
"PenStyle" | pen style as a Integer | |
"BrushColor" | brush color as &H00bbggrr | |
"BrushScale" | brush scale as a Double | |
"BrushAngle" | brush angle as a Double | |
"BrushStyle" | brush style as a Double | |
"TextStyle" | text style as an Integer | |
"ScaleSystem" | scale system as an Integer | |
"BrushDrawMode" | brush drawing mode as n Integer | |
"PenAlignment" | pen alignment as a String | |
"HatchCross" | hatch cross as an Integer | |
"Layer" | layer id as an Integer | |
"Info" | info string as a String | |
"TextFont" | text font as a String | |
"TextFormat" | text format as an Integer | |
"TextSize" | text size as a Double | |
This function will return the number of graphics in the drawing or it will return
the number of graphics contained in a graphic. If you supply a drawing handle as
the first parameter to the function, the count will be the number of top level
graphics in the drawing. If you supply a graphic handle as the first parameter to
the function, the count will be the number of graphics contained in the graphic.
This function can be used with TCWGraphicAt to cycle through all the graphics in the
drawing or graphic.
Long handle | handle of the drawing or graphic | |
This function will return the handle to the requested graphic. The index
should be a number from 1 to the value returned by TCWGraphicCount. If you
are cycling through the graphics in the drawing, use the drawing handle you
used with TCWGraphicCount. If you are cycling through the graphics within a
graphic, use the graphic handle you used with TCWGraphicCount.
Long handle | handle to a drawing or a graphic | |
Long index | requested graphic index | |
This function will add a graphic to the active drawing.
Long g1 | if NULL, add to drawing, otherwise add graphic to this parent graphic | |
Long g2 | graphic to add to drawing | |
This function will add the next segment to the multiline that is in
progress.
Long g | graphic to add next point to | |
Double x0 | X coordinate of point | |
Double y0 | Y coordinate of point | |
Double z0 | Z coordinate of point | |
This function will close the multiline, making the last point the same
as the first point.
Long g | graphic to close | |
This function will add a vertex to a graphic in the active drawing.
Long g | graphic | |
Long v | vertex to add to graphic | |
This function will add a vertex to the specified graphic.
Long g | handle of graphic | |
Double x0 | X coordinate of vertex | |
Double y0 | Y coordinate of vertex | |
Double z0 | Z coordinate of vertex | |
This function will make a new graphic with the same properties as
the specified graphic. The graphic is not added to the drawing. You
must explicitly do this. Use TCWGraphicAppend with the first parameter
NULL to add the graphic to the drawing. use TCWGraphicApend with the
first parameter being the handle of the graphic that will be the
parent of the appended graphic.
Long g | graphic to copy | |
This function will delete the specified graphic.
Long g | graphic to delete | |
This function will create a new graphic with the default drawing setting. TurboCAD
internal types are GK_GRAPHIC (polyline), GK_ARC and GK_TEXT. The regen method name
is the name of the regen dll (without the ".dll")
Long kind | kind of graphic to make | |
String regenmethod | Regen method if external regenerated graphic, use "" if TurboCAD type | |
This function will draw the graphic on the drawing.
Long g | handle of graphic | |
Long mode | 0 is normal and 1 is inverted | |
This function will return the graphic handle from the unique database id.
Long id | unique id of graphic | |
This function will set the graphic's reference point, using the
vertex supplied.
Long g | graphic handle | |
Long v | vertex for new reference point | |
This function will return the graphic reference point.
Long g | graphic handle | |
This function will apply a hatch pattern to a graphic.
Long g | handle of graphic to hatch | |
This function wil create a group out of the selected graphics.
String groupname | name of group | |
This function will explode a selected group or block into its individual
graphics. If the selected graphic is a simple graphic such as a line, the
function has no effect.
This function will move the selected graphics to the front of the drawing.
This function will move the selected graphics to the back of the drawing.
This function will align the bottoms of the selected graphics.
This function will align the tops of the selected graphics.
This function will align the middles of the selected graphics.
This function will align the left sides of the selected graphics.
This function will align the right sides of the selected graphics.
This function will align the centers of the selected graphics.
This function will return the value of the property that has been
requested. This function is written in Basic because of limitations
within Enable Basic for Variants and DLLs.
Long graphic | graphic to get property from | |
String propertyname | name of property look up | |
AVAILABLE PROPERTIES: | DESCRIPTION: | |
"BrushAngle" | brush angle as a Double | |
"BrushColor" | brush color as &H00bbggrr | |
"BrushDrawMode" | brush drawing mode as n Integer | |
"BrushScale" | brush scale as a Double | |
"BrushStyle" | brush style as a Double | |
"DatabaseID" | unique id for graphic | |
"HatchCross" | hatch cross as an Integer | |
"Info" | info string as a String | |
"Layer" | layer id as an Integer | |
"PenAlignment" | pen alignment as a String | |
"PenColor" | pen color as &H00bbggrr | |
"PenScale" | pen scale as a Double | |
"PenStyle" | pen style as a Integer | |
"PenWidth" | pen width as a Double | |
"ScaleSystem" | scale system as an Integer | |
"Selected" | selected flag as a Long | |
"TextFont" | text font as a String | |
"TextFormat" | text format as an Integer | |
"TextSize" | text size as a Double | |
"TextStyle" | text style as an Integer | |
"Closed" | closed flag as a Long (READ ONLY) | |
"Kind" | graphic type as a Long (READ ONLY) | |
"RegenMethod" | regen method name as a String (READ ONLY) | |
AVAILABLE PROPERTIES: | VALUE RETURNED: | |
"BrushAngle" | (Double) | |
"BrushColor" | &H00bbggrr (Long) | |
"BrushDrawMode" | (Integer) | |
"BrushScale" | (Double) | |
"BrushStyle" | (Double) | |
"DatabaseID" | (Long) | |
"HatchCross" | (Integer) | |
"Info" | (String) | |
"Layer" | (Integer) | |
"PenAlignment" | (String) | |
"PenColor" | &H00bbggrr (Long) | |
"PenScale" | (Double) | |
"PenStyle" | (Integer) | |
"PenWidth" | (Double) | |
"ScaleSystem" | (Integer) | |
"Selected" | -1 if selected, 0 if not (Long) | |
"TextFont" | (String) | |
"TextFormat" | (Integer) | |
"TextSize" | (Double) | |
"TextStyle" | (Integer) | |
"Closed" | -1 if closed, 0 if not (Long - READ ONLY) | |
"Kind" | GK_nnnnn (Long - READ ONLY) | |
"RegenMethod" | (String - READ ONLY) | |
This function will set the property with the specified value.
Long graphic | graphic to set property for | |
String propertyname | name of property to modify | |
Variant value | value to set to | |
AVAILABLE PROPERTIES: | VALUE: | |
"BrushAngle" | (Double) | |
"BrushColor" | (Long) | |
"BrushDrawMode" | (Integer) | |
"BrushScale" | (Double) | |
"BrushStyle" | (Integer) | |
"DatabaseID" | (Long) | |
"HatchCross" | (Integer) | |
"Info" | (String) | |
"Layer" | (Integer) | |
"PenAlignment" | (String) | |
"PenColor" | &H00bbggrr (Long) | |
"PenWidth" | 1.5 (Double) | |
"PenScale" | 1 (Double) | |
"PenStyle" | (Integer) | |
"ScaleSystem" | (Integer) | |
"Selected" | 1 to select, 0 to deselect (Integer) | |
"TextStyle" | (Integer) | |
"TextFont" | (String) | |
"TextFormat" | (Integer) | |
"TextSize" | (Double) | |
This function will return the number vertices in the specified graphic.
Long g | graphic to count vertices in | |
This function will return the handle to the vertex requested. Valid index
numbers are 1 to the number returned by VertexCount.
Long g | graphic to get vertex from | |
Long index | vertex to return | |
This function will create a new vertex at the specified coordinates.
Caller is responsible for disposing of this object unless it is added to a graphic.
Double x0 | X coordinate of vertex | |
Double y0 | Y coordinate of vertex | |
Double z0 | Z coordinate of vertex | |
This function will create a new vertex at the coordinates 0,0,0.
Caller is responsible for disposing of this object unless it is added to a graphic.
This function will create a new vertex that is initialized to the
same coordinates as the vertex specified.
Long v | handle of a vertex to copy | |
This function will delete the specified vertex.
Long v | handle of a vertex to delete | |
This function will return the X coorindate of a vertex.
Long v | handle of a vertex | |
This function will set the X coordinate of a vertex.
Long v | handle of a vertex | |
Double x0 | coordinate value | |
This function will return the Y coorindate of a vertex.
Long v | handle of a vertex | |
This function will set the Y coordinate of a vertex.
Long v | handle of a vertex | |
Double y0 | coordinate value | |
This function will return the Z coorindate of a vertex.
Long v | handle of a vertex | |
This function will set the Z coordinate of a vertex.
Long v | handle of a vertex | |
Double z0 | coordinate value | |
This function will set the X and Y coordinates of a vertex.
Long v | handle of a vertex | |
Double x0 | x coordinate value | |
Double y0 | y coordinate value | |
This function will set the X, Y and Z coordinates of a vertex.
Long v | handle of a vertex | |
Double x0 | x coordinate value | |
Double y0 | y coordinate value | |
Double z0 | z coordinate value | |
This function will st the state fo the pen. Sets the up or down
state of the pen at the specified vertex.
Long v | handle of a vertex | |
Long state | TRUE if pen should be down | |
This function will activate the specified view.
Long index | view number | |
This function will return the number of views that are open.
This function will return the handle to the active view.
This function will force a redraw on the current view.
This function will flush any remaining paint messages to the view.
This function will zoom the current view to full view.
This function will zoom in the current view. The amount of zoom is
determined by the zoom factor setting on the Options|Program Setup|General
property page.
This function will zoom out the current view. The amount of zoom is
determined by the zoom factor setting on the Options|Program Setup|General
property page.
This function will zoom to the printed page size.
This function will zoom to a view that contains all of the objects in the drawing.
This function will zoom to a view that is bounded by the rectangle points
specified.
Double x0 | X coordinate of top left corner of rectangle | |
Double y0 | Y coordinate of top left corner of rectangle | |
Double z0 | Z coordinate of top left corner of rectangle | |
Double x1 | X coordinate of lower right corner of rectangle | |
Double y1 | Y coordinate of lower right corner of rectangle | |
Double z1 | Z coordinate of lower right corner of rectangle | |
This function will return x coordinate which represents the top left
corner of the view.
This function will return y coordinate which represents the top left
corner of the view.
This function will return z coordinate which represents the top left
corner of the view.
This function will return x coordinate which represents the bottom right
corner of the view.
This function will return y coordinate which represents the bottom right
corner of the view.
This function will return z coordinate which represents the bottom right
corner of the view.
This function will return the number of layers in the active drawing.
This function will return the layer in the active drawing, requested by the index.
This function will delete the layer in the active drawing, requested by the index.
Long Index | layer to delete | |
This function will return the value of the property that has been
requested. This mechanism is being used to get around Enable 3.0
non-support for Variants in DLLs.
Long layer | layer id returned from LayerAt | |
String propertyname | name of property look up | |
AVAILABLE PROPERTIES: | DESCRIPTION: | |
"visible" | is layer visible in drawing | |
"readonly" | is layer read only | |
"color" | layer color | |
"linestyle" | layer line style | |
"name" | layer name | |
AVAILABLE PROPERTIES: | VALUE RETURNED: | |
"visible" | -1 if visible, 0 if not | |
"readonly" | -1 if read only, 0 if not | |
"color" | &H00bbggrr as a Long | |
"linestyle" | layer line style as a Long | |
"name" | layer name as a String | |
This function will set the property with the specified value.
Long layer | layer id | |
String propertyname | name of property to modify | |
Variant value | value to set to | |
AVAILABLE PROPERTIES: | VALUES: | |
"visible" | 1 to set visible, 0 to unset | |
"readonly" | 1 to set readonly, 0 to unset | |
"color" | &H00bbggrr | |
"linestyle" | tbd | |
"name" | String | |
This function will open a text file for input.
String filename | name of file to open for reading. | |
This function reads characters from the input file (fd) until it reaches a:
space, next line, of eof or the max number of characters has been read (256).
Long fd | file descriptor returned by OpenInput | |
String strtext | buffer for data to be read into | |
This function reads the entire line from the input file (fd) into the buffer pbstrBuffer.
The line separator character is '\n'. '\r' is ignored.
Long fd | file descriptor returned by OpenInput | |
String strtext | buffer for data to be read into | |
This function closes the input file.
Long fd | file descriptor returned by OpenInput | |
This function will open a text file for output.
String filename | name of file to open for writing. | |
This function writes the buffer bstrBuffer to the file (fd).
Long fd | file descriptor returned by OpenOutput | |
String strtext | buffer for data to be read into | |
Note that | max number of bytes you can write is 0xFFFE (65534). | |
This function closes the output file.
Long fd | file descriptor returned by OpenOutput | |
This function will set the vertex to the value of the next mouse pick in the
active viewport. The user should use the left mouse button. A value will not be
returned until the mouse button is released.
Long v | handle to a vertex | |
String promp | prompt for user | |
Long g | handle of a graphic to drag (or NULL) | |
Long vd | reference to a vertex in the drag graphic (or NULL) | |
Long os | snap modes which give "magnetic: functionality | |
This function will update the supplied vertex's X, Y, and Z coordinates with the
X, Y, and Z coordinates of the closest vertex based on the snap mode used.
Long v | handle to a vertex | |
Long os | snap modes which are active combination of the following values: | |
. . | SNAP_NEARESTPOINT 0x0008 | |
. . | SNAP_MIDPOINT 0x0020 | |
. . | SNAP_CENTER 0x0040 | |
. . | SNAP_QUADRANTPOINT 0x0080 | |
. . | SNAP_ANYPOINT 0x00FC | |
. . | SNAP_NEARESTENTITY 0x0100 (overides other snaps) | |
This function with return the handle to the graphic that is closest to the
supplied vertex.
Long v | handle to a vertex | |