Welcome
Expand Getting StartedGetting Started
Expand SOLIDWORKS API HelpSOLIDWORKS API Help
Expand SOLIDWORKS PDM Professional API HelpSOLIDWORKS PDM Professional API Help
Expand FeatureWorks API HelpFeatureWorks API Help
Expand SOLIDWORKS Costing API HelpSOLIDWORKS Costing API Help
Expand SOLIDWORKS Document Manager API HelpSOLIDWORKS Document Manager API Help
Expand SOLIDWORKS Routing API HelpSOLIDWORKS Routing API Help
Expand SOLIDWORKS Simulation API HelpSOLIDWORKS Simulation API Help
Expand SOLIDWORKS Sustainability API HelpSOLIDWORKS Sustainability API Help
Expand SOLIDWORKS Toolbox API HelpSOLIDWORKS Toolbox API Help
Expand SOLIDWORKS Utilities API HelpSOLIDWORKS Utilities API Help
Expand eDrawings API HelpeDrawings API Help
Expand DraftSight API HelpDraftSight API Help
Expand Lisp Programming BasicsLisp Programming Basics
Expand Lisp Functions OverviewLisp Functions Overview
Collapse Lisp Functions ReferenceLisp Functions Reference
Lisp Functions by Alphabetical Order
*error*
+ (Addition)
- (Subtraction)
* (Multiplication)
/ (Division)
1+ (Increment)
1- (Decrement)
Equal
Not equal
Greater than
Greater than or equal
Less than
Less than or equal
~ (Bitwise NOT)
abs
acad_colordlg
acad_strlsort
action_tile
add_list
alert
alloc
and
angle
angtof
angtos
append
apply
ascii
assoc
atan
atof
atoi
atom
atoms-family
boole
boundp
car
caaaar ... cddddr
cdr
chr
client_data_tile
close
command
cond
cons
cos
defun
dictadd
dictnext
dictremove
dictrename
dictsearch
dimx_tile
dimy_tile
distance
distof
done_dialog
end_image
end_list
entdel
entget
entlast
entmake
entmakex
entmod
entnext
entsel
entupd
eq
equal
eval
exit
exp
expand
expt
fill_image
findfile
fix
float
foreach
gc
gcd
get_attr
get_tile
getangle
getcfg
getcname
getcorner
getdist
getenv
getfiled
getint
getkword
getorient
getpoint
getreal
getstring
getvar
graphscr
grclear
grdraw
grread
grtext
grvecs
handent
help
if
initget
inters
itoa
lambda
last
length
list
listp
load
load_dialog
log
logand
logior
lsh
mapcar
max
mem
member
menucmd
menugroup
min
minusp
mode_tile
namedobjdict
nentsel
nentselp
new_dialog
not
nth
null
numberp
open
or
osnap
pi (Constant)
polar
prin1
princ
print
progn
prompt
quit
quote
read
read-char
read-line
redraw
regapp
rem
repeat
reverse
rtos
set
set_tile
setcfg
setenv
setfunhelp
setq
setvar
setview
sin
slide_image
snvalid
sqrt
ssadd
ssdel
ssget
sslength
ssmemb
ssname
start_dialog
start_image
start_list
startapp
strcase
strcat
strlen
subst
substr
tan
tblnext
tblobjname
tblsearch
term_dialog
terpri
textbox
textpage
textscr
trans
type
unload_dialog
vector_image
ver
vmon
vports
wcmatch
while
write-char
write-line
xdroom
xdsize
zerop
Hide Table of Contents

entmake

(entmake data)

The entmake function generates a new drawing entity (a basic entity or a complex object such as a polyline or a block insertion) in the current drawing database and displays it in the current drawing.

Arguments

data contains the defining data of the entity to be created.

The format of this list is similar to that returned by the entget function.

The entget function retrieves the defining data of an existing drawing entity and manipulates this entity data to create a new entity.

Also, in certain situations a technique may be applicable, where the entity whose defining data have been retrieved by the entget function is deleted and then restored as a drawing entity equivalent in entity type but modified in its geometric or property parameters by using the entmake function.

But in this case the entity reference (handles) and the database address (entity name) has changed although the visual representation of the entity in the graphic window(s) can be the same as before. The entmake function tests the validity of the values supplied for Layer name, Color, Linetype and TextStyle before the entity is generated:

  • If the layer name supplied is not found in the layer table of the current drawing, entmake creates that new layer using the default values of Layer 0.
  • An invalid Color value results in the function returning nil.
  • A LineStyle or a TextStyle not yet defined in the corresponding table of the current database results in the function returning nil.

The type of the entity must be specified in the first or second element of the list. If the type is specified in the second buffer, the first buffer may contain only the entity name, which is ignored. If an entity reference (handle) is found in the list, it is ignored. The system automatically generates a new handle for the new drawing entity.

If an entity name (group code -1) is found in the list, it is ignored. The system generates a new Entity Name for the new entity.

Creating Complex Objects

Complex objects (PolyLines, Block definitions, Attributes of block insertions) are created by multiple calls of entmake. The first call generates the base element (POLYLINE, BLOCK, or INSERT). The function recognizes that a complex object is affected and stores the current data contents and the following data functions temporarily. The following calls of the entmake function will define the sub-elements (vertices in POLYLINEs, Attributes in BLOCK insertions, and entities defining a BLOCK). The sub-elements are temporarily added up, until the entmake function makes a statement indicating definition termination of a complex drawing object. This indication is done by specifying a ENDBLK "entity" (when defining a BLOCK) or a SEQEND "entity" (when defining a POLYLINE or an INSERT that generates a BLOCK insertion).

The definition of a complex drawing object may be canceled by entering entmake with no arguments. The temporary stored object is then refused.

If an error occurs during the generation of a sub-entity, the sub-entity is refused, but the entities generated so far remain. This allows error handling by the developer.

Anonymous Definitions

The BLOCK definition table of the drawing database may contain anonymous blocks. Cross-hatchings and dimensions are anonymous blocks. The user cannot use anonymous blocks directly (for example in the Insert command), because the block names are unknown to the user. Lisp allows access to anonymous blocks.

Anonymous blocks are created by dimensioning and hatch commands. The application developer can generate anonymous blocks with the entmake function.

An anonymous block created with entmake has a block name like *Uxxxxxx, where the first two characters mark the block as created by entmake. The following characters contain a unique number to identify the block. This block number is only valid during the current work session. If the drawing is reopened, a new number for the anonymous block is generated.

entmake recognizes automatically that an anonymous block has to be created, if the block name (group 2) is "*U". entmake adds a unique identifier to the internal block name. Furthermore, entmake sets the flag "Block type" (group 70) in the block definition.

Return Value

If the function succeeds, it returns the list containing the entity definition data; otherwise, the function returns nil.

Example

: (entmake '((0 . "LINE")(10 0.0 0.0 0.0)(11 10.0 10.0 0.0)))

In the example above, group code 10 specifies the start point, and group code 11 the end point of a Line entity.



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Function entmake
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:



x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2019 SP04

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.