马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- (defun XD::Text:Adjust (ents / 9pt1 box ecs mat
- mat0 mat1 mat2 mirrInx mirrIny
- p0 p0_1 p1 vx vy vz
- atts txts eblk
- )
- (defun _tMirr (e)
- (setq mirrInx (xdrx_text_ismirroredInx e)
- mirrIny (xdrx_text_ismirroredIny e)
- )
- (if mirrInx
- (xdrx_text_setMirrorInx e nil)
- )
- (if mirrIny
- (xdrx_text_setMirrorIny e nil)
- )
- (if (or mirrInx mirrIny)
- (progn (setq box (XD::Entity:BoxAtEcs e e)
- 9pt1 (XD::Geom:BOX->9PT box)
- p0_1 (last 9pt1)
- )
- (xdrx_entity_transform
- e
- (xdrx_matrix_setTranslation mat0 (mapcar '- p0 p0_1))
- )
- )
- )
- )
- (cond
- ((xdrx_object_iskindof ents "INSERT")
- (setq atts (xdrx_getpropertyvalue ents "attributeentities"))
- (setq txts (xdrx_block_getentities ents '((0 . "TEXT"))))
- (setq txts (append txts atts))
- (setq eblk ents)
- (setq ents txts)
- )
- ((xdrx_object_iskindof ents "ATT*,TEXT")
- (setq ents (list ents))
- )
- ((= (type ents) 'PICKSET)
- (setq ents (xdrx_pickset->ents ents))
- )
- (t (setq ents nil))
- )
- (setq i 0)
- (mapcar
- '(lambda (e)
- (setq ecs (xdrx_entity_getecs e)
- vx (cadr ecs)
- vy (caddr ecs)
- vz (last ecs)
- box (xdrx_entity_box e vx)
- 9pt1 (XD::Geom:BOX->9PT box)
- p1 (car box)
- p0 (last 9pt1)
- mat0 (xdrx_matrix_identity 3)
- mat1 mat0
- mat2 mat0
- p1 (xdrx_getpropertyvalue e "9pt" 5)
- )
- (_tMirr e)
- (if (< (car vx) 0.0)
- (progn (setq mat1 (xdrx_matrix_setrotation mat0 pi vy p0)))
- )
- (if (< (cadr vy) 0.0)
- (progn (setq mat2 (xdrx_matrix_setrotation mat0 pi vx p0)))
- )
- (setq mat (xdrx_matrix_product mat2 mat1))
- (if (not (equal mat mat0))
- (progn (xdrx_entity_transform e mat)
- (xdrx_entity_move e (xdrx_getpropertyvalue e "9pt" 5) p1)
- (setq i (1+ i))
- )
- )
- )
- ents
- )
- (xdrx_object_regen eblk)
- i
- )
|