public class AutocadScript2D extends AutocadScript implements Serializable
AutocadScript.TextAnchor
Constructor and Description |
---|
AutocadScript2D()
The default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
drawLine(BigDecimal x_start,
BigDecimal y_start,
BigDecimal x_end,
BigDecimal y_end)
Draws a straight line between two points.
|
void |
insertBlock(String block_name,
BigDecimal x_coordinate,
BigDecimal y_coordinate)
Inserts an existing block at the specified coordinates.
|
void |
insertBlock(String block_name,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
List<String> attributes)
Inserts an existing block at the specified coordinates.
|
void |
insertBlockRotated(String block_name,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal rotation_angle)
Inserts an existing block at the specified coordinates, rotated by the
specified angle.
|
void |
insertBlockRotated(String block_name,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal rotation_angle,
List<String> attributes)
Inserts an existing block at the specified coordinates, rotated by the
specified angle.
|
void |
insertBlockScaled(String block_name,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal scale_factor)
Inserts an existing block at the specified coordinates, with the
specified scaling factor.
|
void |
insertBlockScaled(String block_name,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal scale_factor,
List<String> attributes)
Inserts an existing block at the specified coordinates, with the
specified scaling factor.
|
void |
insertBlockScaledRotated(String block_name,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal scale_factor,
BigDecimal rotation_angle)
Inserts an existing block at the specified coordinates, with the
specified scaling factor and rotated by the specified angle.
|
void |
insertBlockScaledRotated(String block_name,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal scale_factor,
BigDecimal rotation_angle,
List<String> attributes)
Inserts an existing block at the specified coordinates, with the
specified scaling factor and rotated by the specified angle.
|
void |
insertDimension(BigDecimal x_start,
BigDecimal y_start,
BigDecimal x_end,
BigDecimal y_end,
BigDecimal x_pos,
BigDecimal y_pos)
Inserts the aligned dimension measurement.
|
void |
insertFileAsBlock(String filename,
BigDecimal x_coordinate,
BigDecimal y_coordinate)
Inserts the specified file at the specified coordinates.
|
void |
insertFileAsBlockRotated(String filename,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal rotation_angle)
Inserts the specified file at the specified coordinates, rotated by the
specified angle.
|
void |
insertFileAsBlockScaled(String filename,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal scale_factor)
Inserts the specified file at the specified coordinates, with the
specified scaling factor.
|
void |
insertFileAsBlockScaledRotated(String filename,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal scale_factor,
BigDecimal rotation_angle)
Inserts the specified file at the specified coordinates, with the
specified scaling factor and rotated by the specified angle.
|
void |
insertText(String text,
BigDecimal x_coordinate,
BigDecimal y_coordinate)
Inserts an arbitrary text at the specified coordinates.
|
void |
insertText(String text,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
AutocadScript.TextAnchor anchor)
Inserts an arbitrary text at the specified coordinates, with a particular
anchor type.
|
void |
insertText(String text,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal fontsize)
Inserts an arbitrary text at the specified coordinates, with a particular
font size.
|
void |
insertText(String text,
BigDecimal x_coordinate,
BigDecimal y_coordinate,
BigDecimal fontsize,
AutocadScript.TextAnchor anchor)
Inserts an arbitrary text at the specified coordinates, with a particular
font size and anchor type.
|
getDefaultFontSize, getDefaultScaleFactor, getDefaultTextAnchor, getSb, getUsedFiles, insertArbitraryCommand, setDefaultFontSize, setDefaultScaleFactor, setDefaultTextAnchor, setSb, setUsedFiles, updateBlockAttributeValue
public void drawLine(BigDecimal x_start, BigDecimal y_start, BigDecimal x_end, BigDecimal y_end)
The line's parameters (such as width) will follow whatever is currently the default in the drawing.
x_start
- The x coordinate for the starting pointy_start
- The y coordinate for the starting pointx_end
- The x coordinate for the end pointy_end
- The y coordinate for the end pointpublic void insertBlock(String block_name, BigDecimal x_coordinate, BigDecimal y_coordinate)
block_name
- The name of the block to be inserted. The block must
already exist within the base DWG file. The system cannot check
this, and any error will only come once the script is executed on
the Autodesk server, thus what kind of error message will be
returned cannot be guaranteedx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingpublic void insertBlock(String block_name, BigDecimal x_coordinate, BigDecimal y_coordinate, List<String> attributes)
block_name
- The name of the block to be inserted. The block must
already exist within the base DWG file. The system cannot check
this, and any error will only come once the script is executed on
the Autodesk server, thus what kind of error message will be
returned cannot be guaranteedx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingattributes
- The list of block attributes. These have to be given in
the correct order as defined in the block itselfpublic void insertBlockRotated(String block_name, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal rotation_angle)
block_name
- The name of the block to be inserted. The block must
already exist within the base DWG file. The system cannot check
this, and any error will only come once the script is executed on
the Autodesk server, thus what kind of error message will be
returned cannot be guaranteedx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingrotation_angle
- The angle the model will be rotated by. The unit of
this rotation (degree, radian, or others) and whether the rotation
is clockwise or anti-clockwise depends on the settings in the base
DWG filepublic void insertBlockRotated(String block_name, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal rotation_angle, List<String> attributes)
block_name
- The name of the block to be inserted. The block must
already exist within the base DWG file. The system cannot check
this, and any error will only come once the script is executed on
the Autodesk server, thus what kind of error message will be
returned cannot be guaranteedx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingrotation_angle
- The angle the model will be rotated by. The unit of
this rotation (degree, radian, or others) and whether the rotation
is clockwise or anti-clockwise depends on the settings in the base
DWG fileattributes
- The list of block attributes. These have to be given in
the correct order as defined in the block itselfpublic void insertBlockScaled(String block_name, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal scale_factor)
block_name
- The name of the block to be inserted. The block must
already exist within the base DWG file. The system cannot check
this, and any error will only come once the script is executed on
the Autodesk server, thus what kind of error message will be
returned cannot be guaranteedx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingscale_factor
- The the model will be inserted into the drawing
scaled according to this factor. For example, if the scaling
factor is 0.5, the model will be inserted half as big in both the
X and Y direction as in the original filepublic void insertBlockScaled(String block_name, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal scale_factor, List<String> attributes)
block_name
- The name of the block to be inserted. The block must
already exist within the base DWG file. The system cannot check
this, and any error will only come once the script is executed on
the Autodesk server, thus what kind of error message will be
returned cannot be guaranteedx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingscale_factor
- The the model will be inserted into the drawing
scaled according to this factor. For example, if the scaling
factor is 0.5, the model will be inserted half as big in both the
X and Y direction as in the original fileattributes
- The list of block attributes. These have to be given in
the correct order as defined in the block itselfpublic void insertBlockScaledRotated(String block_name, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal scale_factor, BigDecimal rotation_angle)
block_name
- The name of the block to be inserted. The block must
already exist within the base DWG file. The system cannot check
this, and any error will only come once the script is executed on
the Autodesk server, thus what kind of error message will be
returned cannot be guaranteedx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingscale_factor
- The the model will be inserted into the drawing
scaled according to this factor. For example, if the scaling
factor is 0.5, the model will be inserted half as big in both the
X and Y direction as in the original filerotation_angle
- The angle the model will be rotated by. The unit of
this rotation (degree, radian, or others) and whether the rotation
is clockwise or anti-clockwise depends on the settings in the base
DWG filepublic void insertBlockScaledRotated(String block_name, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal scale_factor, BigDecimal rotation_angle, List<String> attributes)
block_name
- The name of the block to be inserted. The block must
already exist within the base DWG file. The system cannot check
this, and any error will only come once the script is executed on
the Autodesk server, thus what kind of error message will be
returned cannot be guaranteedx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingscale_factor
- The the model will be inserted into the drawing
scaled according to this factor. For example, if the scaling
factor is 0.5, the model will be inserted half as big in both the
X and Y direction as in the original filerotation_angle
- The angle the model will be rotated by. The unit of
this rotation (degree, radian, or others) and whether the rotation
is clockwise or anti-clockwise depends on the settings in the base
DWG fileattributes
- The list of block attributes. These have to be given in
the correct order as defined in the block itselfpublic void insertDimension(BigDecimal x_start, BigDecimal y_start, BigDecimal x_end, BigDecimal y_end, BigDecimal x_pos, BigDecimal y_pos)
This will measure the straight-line distance between two points and displays the value. The value will be printed parallel to the line between the two measured points at a certain distance away, which is determined by the position of the third point.
x_start
- The x coordinate for the first point to be measuredy_start
- The y coordinate for the first point to be measuredx_end
- The x coordinate for the second point to be measuredy_end
- The y coordinate for the second point to be measuredx_pos
- The x coordinate for the position of the measurement valuey_pos
- The y coordinate for the position of the measurement valuepublic void insertFileAsBlock(String filename, BigDecimal x_coordinate, BigDecimal y_coordinate)
filename
- The file name of the model to be inserted. The file must
have been uploaded already through the Model / AutoCAD Management
screenx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingpublic void insertFileAsBlockRotated(String filename, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal rotation_angle)
filename
- The file name of the model to be inserted. The file must
have been uploaded already through the Model / AutoCAD Management
screenx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingrotation_angle
- The angle the model will be rotated by. The unit of
this rotation (degree, radian, or others) and whether the rotation
is clockwise or anti-clockwise depends on the settings in the base
DWG filepublic void insertFileAsBlockScaled(String filename, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal scale_factor)
filename
- The file name of the model to be inserted. The file must
have been uploaded already through the Model / AutoCAD Management
screenx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingscale_factor
- The the model will be inserted into the drawing
scaled according to this factor. For example, if the scaling
factor is 0.5, the model will be inserted half as big in both the
X and Y direction as in the original filepublic void insertFileAsBlockScaledRotated(String filename, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal scale_factor, BigDecimal rotation_angle)
filename
- The file name of the model to be inserted. The file must
have been uploaded already through the Model / AutoCAD Management
screenx_coordinate
- The x coordinate at which the model will be inserted
into the drawingy_coordinate
- The y coordinate at which the model will be inserted
into the drawingscale_factor
- The the model will be inserted into the drawing
scaled according to this factor. For example, if the scaling
factor is 0.5, the model will be inserted half as big in both the
X and Y direction as in the original filerotation_angle
- The angle the model will be rotated by. The unit of
this rotation (degree, radian, or others) and whether the rotation
is clockwise or anti-clockwise depends on the settings in the base
DWG filepublic void insertText(String text, BigDecimal x_coordinate, BigDecimal y_coordinate)
The text will be printed with the default font size and anchor type.
text
- The text to be printedx_coordinate
- The x coordinate at which the text will be inserted
into the drawingy_coordinate
- The y coordinate at which the text will be inserted
into the drawingpublic void insertText(String text, BigDecimal x_coordinate, BigDecimal y_coordinate, AutocadScript.TextAnchor anchor)
The text will be printed with the default font size.
text
- The text to be printedx_coordinate
- The x coordinate at which the text will be inserted
into the drawingy_coordinate
- The y coordinate at which the text will be inserted
into the drawinganchor
- The anchor type to usepublic void insertText(String text, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal fontsize)
The text will be printed with the default anchor type.
text
- The text to be printedx_coordinate
- The x coordinate at which the text will be inserted
into the drawingy_coordinate
- The y coordinate at which the text will be inserted
into the drawingfontsize
- The font size to usepublic void insertText(String text, BigDecimal x_coordinate, BigDecimal y_coordinate, BigDecimal fontsize, AutocadScript.TextAnchor anchor)
text
- The text to be printedx_coordinate
- The x coordinate at which the text will be inserted
into the drawingy_coordinate
- The y coordinate at which the text will be inserted
into the drawingfontsize
- The font size to useanchor
- The anchor type to use