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

grvecs

(grvecs vector_list [matrix])

The grvecs function lets you draw one or more vectors in the current viewport of the active drawing. The vectors are temporary and disappear with any command that refreshes the current viewport. The vectors can be displayed in any of the 255 system colors, and can be highlighted or drawn in XOR color.

Arguments

vector_list

The argument vector_list contains one or more pairs of a real number defining a color number and two point lists defining the start and end point of the vector to be drawn.

The format of the argument vector_list is as follows:

([color1] from_point_1 to_point_1

 [color2] from_point_2 to_point_2

 ...

)

A pair of point lists, from_point_n and to_point_n, determine the end points by vector coordinates of the current CCS. These points can be defined in two dimensions or three dimensions. The points must be passed two by two for the grvecs function to be processed successfully. The value that defines the color is valid for succeeding vectors, as long as no other color is defined in subsequent parameters within the vector list.

Color Meaning
-1 Vector is highlighted
0 - 255 Standard colors
256 Vector is drawn in XOR ink

If the integer value specified for color is less than 0, the vector is highlighted.

If the integer value specified for color is greater than 255, the vectors are drawn in XOR ink. XOR ink complements anything it draws over.

matrix

The argument matrix is a 4x4 transformation matrix that transforms the vectors before they are displayed.

The argument allows manipulation of the location and the proportion of the vectors defined in the vector list. The matrix is a list that contains four additional lists that are composed of real numbers.

Return Value

The function always returns nil (indicating that it has been processed successfully).

Note: If the vectors exceed the current display, they are clipped.

Examples

The expession

(grvecs '( 1 (1.0 1.0) (1.0 6.0)))

draws a vertical red vector from 1,1 to 1,6 in the graphics area.

The expession

(grvecs '( -1 (1.0 1.0) (1.0 6.0)))

draws a highlighted vector from 1,1 to 1,6 in the graphics area.

The following expression draws five lines in different colors in the current viewport:

(grvecs '(1 (1 2)(1 5)    draws a red (1) line from 1,2 to 1,5

          2 (2 2)(2 5)    draws a yellow (2) line from 2,2 to 2,5

          3 (3 2)(3 5)    draws a green (3) line from 3,2 to 3,5

          4 (4 2)(4 5)    draws a cyan (4) line from 4,2 to 4,5

          5 (5 2)(5 5)    draws a blue (5) line from 5,2 to 5,5

))

The matrix below represents a uniform scaling of 1.0 and a parallel displacement of 3.0,3.0,0.0.

'((1.0 0.0 0.0 3.0)

  (0.0 1.0 0.0 3.0)

  (0.0 0.0 1.0 0.0)

  (0.0 0.0 0.0 1.0)

)

Related Functions

grdraw, grread

grdraw draws a single vector in the graphics area



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 grvecs
*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.