Группы пользователей Autodesk


Изучение кода


Создание плиток

 

Создание плиток  

Изучение кода

Теперь посмотрим на код функции gp:calculate-Draw-TileRow:

(defun gp:calculate-Draw-TileRow (startPoint TileRadius

TileSpace pathWidth pathAngle offsetFromCenter

ObjectCreationStyle / HalfWidth TileDiameter

ObjectCreationFunction angp90 angm90

firstCenterPt TileCenterPt TileList)

(setq HalfWidth (- (/ pathWidth 2.00) TileRadius)

Tilespacing (+ (* TileRadius 2.0) TileSpace)

TileDiameter (* TileRadius 2.0)

angp90 (+ PathAngle (Degrees->Radians 90))

angm90 (- PathAngle (Degrees->Radians 90))

firstCenterPt (polar startPoint angp90 offsetFromCenter)

tileCenterPt firstCenterPt

ObjectCreationStyle(strcase ObjectCreationStyle)

ObjectCreationFunction

(cond

((equal ObjectCreationStyle "ACTIVEX")

gp:Create_activeX_Circle

)

((equal ObjectCreationStyle "ENTMAKE")

gp:Create_entmake_Circle

)

((equal ObjectCreationStyle "COMMAND")

gp:Create_command_Circle

)

(T

(alert (strcat "ObjectCreationStyle in function

gp:calculate?Draw?TileRow"

"\nis invalid. Contact developer for assistance."

"\n ObjectCreationStyle set to ACTIVEX"

)

)

setq ObjectCreationStyle "ACTIVEX")

)

)

)

;; Draw the circles to the left of the center.

(while (< (distance startPoint tileCenterPt) HalfWidth)

;; Add each tile to the list to return.

(setq tileList

(cons

(ObjectCreationFunction tileCenterPt TileRadius)

tileList

)

)

;; Calculate the center point for the next tile.

(setq tileCenterPt

(polar tileCenterPt angp90 TileSpacing)

)

);_ end of while

;; Draw the circles to the right of the center.

(setq tileCenterPt

(polar firstCenterPt angm90 TileSpacing))

(while (< (distance startPoint tileCenterPt) HalfWidth)

;; Add each tile to the list to return.

(setq tileList

(cons

(ObjectCreationFunction tileCenterPt TileRadius)

tileList

)

)

;; Calculate the center point for the next tile.

(setq tileCenterPt (polar tileCenterPt angm90 TileSpacing))




Начало  Назад  Вперед



Книжный магазин