(defun C:ARRSIZE
(/ basept col# coldist colspac method row# rowdist rowspac
) (UTIL:SETDEBUG "ARSI:UPDATEBLOCK")
rowspac 72 ; from block and retrieved with xdata
colspac 30 ; from block and retrieved with xdata
) ;_ end of setq
(setq method
(getkword "\nSelect input method [Cursor/Keyboard]: ")) (ARSI:DRAWRECTANGLE)
) ;_ end of if
(setq row#
(getint "\nInput the number of rows: ")) (setq col#
(getint "Input the number of columns: ")) ) ;_ end of progn
) ;_ end of if
(princ "\nUpdating the array. ") (if (setq rowdist
(* row# rowspac
)) (UTIL:PUTPROPERTY
entnam
"Vertical Array Distance"
rowdist
vlax-vbdouble
) ;_ end of UTIL:PUTPROPERTY
(alert "Row Distance not set.") ) ;_ end of if
(if (setq coldist
(* col# colspac
)) (UTIL:PUTPROPERTY
entnam
"Horizontal Array Distance"
coldist
vlax-vbdouble
) ;_ end of UTIL:PUTPROPERTY
(alert "Column Distance not set.") ) ;_ end of if
(vl-cmdf "._updatefield" entnam
"") (UTIL:RESETDEBUG)
) ;_ end of defun - ARSI:UPDATEBLOCK
;;;-------------------------------------------------------------------------------------;
;;; Function: ARSI:DRAWRECTANGLE ;
;;;-------------------------------------------------------------------------------------;
;;;
;;;
;; GrText Demo Program 3 - Lee Mac
;; Prompts the user for a base point and displays
;; the area of the rectangular region enclosed by the
;; base point and cursor as the cursor is moved across the screen.
;;
;; Requires: GrText.lsp
;;;-------------------------------------------------------------------------------------;
(defun ARSI:DRAWRECTANGLE
(/ cursor dis pt1 pt2 pt3 pt4 vector
) pt1
(trans basept entnam vector
) basept
(trans basept entnam
1) ) ;_ end of setq
pt3
(trans cursor
1 vector
) col#
(fix (/ (- (car cursor
) (car basept
)) colspac
)) ) ;_ end of setq
(if (and (>= row#
1) (>= col#
1)) (LM:DisplayGrText
cursor
) ;_ end of LM:GrText
3
15
45
) ;_ end of LM:DisplayGrText
(LM:DisplayGrText
cursor
4
15
15
) ;_ end of LM:DisplayGrText
) ;_ end of progn
(LM:DisplayGrText
cursor
(LM:
GrText "Zero or negative values NOT allowed!") 1
15
15
) ;_ end of LM:DisplayGrText
) ;_ end of if
;; ** line to update **
;; ** line to update **
-256
256
) ;_ end of if
basept pt2 pt2 cursor cursor pt4 pt4 basept
) ;_ end of list
) ;_ end of grvecs
) ;_ end of while
) ;_ end of defun - ARSI:DRAWRECTANGLE
;; Display GrText - Lee Mac
;; pnt - cursor point in UCS
;; vec - GrText vector list
;; col - Text Colour (ACI Colour)
;; xof - x-offset from cursor in pixels
;; yof - y-offset from cursor in pixels
(defun LM:DisplayGrText
( pnt vec col xof yof
/ scl
) )
(list scl
0.0 0.0 (+ (car pnt
) (* xof scl
))) (list 0.0 scl
0.0 (+ (cadr pnt
) (* yof scl
))) '(0.0 0.0 0.0 1.0)
)
)
)
(defun UTIL:PUTPROPERTY
(entname propname varval vartype
/ object proplist
) (setq proplist
(vla
-getdynamicblockproperties object
)) (setq proplist
(vlax
-safearray
->list proplist
)) (vla-put-value
item
) ;_ end of vla-put-value
) ;_ end of if
) ;_ end of foreach
) ;_ end of defun - UTIL:PUTPROPERTY