马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;|
- 绘制十字交叉线(块),
- 参数:
- pnt --- 插入点 (WCS)
- len --- 线长
- ang --- 角度(弧度)
- blknastr-块名后缀(前缀固定为XDOB_CROSSHAIR_),如果给 "" , 后缀随机三位字符
- 如果有同名块存在,替换掉
- 返回值:INSERT实体名
- |;
- (defun XD::Pnt:MakeCrossHair (pnt len ang blknastr / blkname direc mat norm ss v1 v1- v2 v2- x yAxis)
- (setq norm (XD::UCS:zDir)
- direc (xdrx_vector_rotate '(1 0 0) (float ang) norm)
- direc (xdrx_vector_normalize direc)
- yAxis (xdrx_vector_perpVector direc)
- v1 (xdrx_vector_product direc (/ 1 2.0))
- v1- (xdrx_vector_negate v1)
- v2 (xdrx_vector_product yAxis (/ 1 2.0))
- v2- (xdrx_vector_negate v2)
- )
- (xdrx_setmark)
- (mapcar
- '(lambda (x)
- (xdrx_line_make (mapcar
- '+
- pnt
- (car x)
- ) (mapcar
- '+
- pnt
- (cadr x)
- )
- )
- (xdrx_setpropertyvalue (entlast) "color" 0)
- )
- (list (list v1 v1-) (list v2 v2-))
- )
- (if (= "" blknastr)
- (setq blknastr (xdrx_getrandstr))
- )
- (setq ss (xdrx_getss)
- blkname (strcat "XDOB_CROSSHAIR_" blknastr)
- )
- (setq mat (xdrx_matrix_setTranslation (xdrx_matrix_identity 3) (mapcar
- '-
- '(0 0 0)
- pnt
- )
- )
- )
- (xdrx_entity_transform ss mat)
- (setq blkname (xdrx_block_make blkname ss '(0 0 0) t))
- (xdrx_entity_transform (entlast) (xdrx_matrix_inverse mat))
- (xdrx_setpropertyvalue (entlast) "ScaleFactors" (list len len len))
- (entlast)
- )
|