属性块文字跑位问题2020版本
属性块文字跑位问题2020版本附件求解
ferious 发表于 2024-2-24 10:51
问题来源:是这样的,打开2020文件,无移动操作,该属性块文字不显示,故而发布打印无法显示。
问题解决 ...
如果显示没问题只是位置跑偏,原位移动就可以解决,MOVE0,00,0
如果是后台生成的,由于无法准确计算对齐点,可以先在一个临时块内生成后再复制到目标空间就不会产生跑偏的问题也无需计算对齐点坐标
如果直接不显示需要换字体 本帖最后由 hao3ren 于 2024-2-23 21:57 编辑
;;;(gxl-blk-att2init ent) 图块属性还原归位
;测试 (gxl-blk-att2init (car(entsel "\n选择图块")))
(defun gxl-blk-att2init (ent / obj inspt
Ownerobj atts objs
attinspt rot xscale
yscale zscaleAlignment
Backward ObliqueAngleRotation
TextAlignmentPoint
TextGenerationFlag UpsideDown
TrueColor
)
(if (= 'ename (type ent))
(setq obj (vlax-ename->vla-object ent))
(setq obj ent)
)
(setq Ownerobj (vla-Item (vla-get-blocks (vla-get-ActiveDocument(vlax-get-acad-object))) (vla-get-name obj)))
(vlax-for a Ownerobj
(setq objs (cons a objs))
)
(setq objs (reverse objs))
(setq rot (vla-get-Rotation obj)
xscale (vla-get-XScaleFactor obj)
yscale (vla-get-yScaleFactor obj)
zscale (vla-get-zScaleFactor obj)
)
(vla-put-Rotation obj 0)
(vla-put-XScaleFactor obj 1)
(vla-put-yScaleFactor obj 1)
(vla-put-zScaleFactor obj 1)
(setq atts (vla-GetAttributes obj)
atts (safearray-value(vlax-variant-value atts))
inspt (vlax-safearray->list(vlax-variant-value (vla-get-InsertionPoint obj)))
)
(if atts
(progn
(foreach att atts
(vl-some '(lambda (x) (= (GXL-CATCHAPPLY vla-get-TagString (list (setq Ownerobj x))) (vla-get-TagString att)))objs)
(setq attinspt (vlax-safearray->list (vlax-variant-value(vla-get-InsertionPoint Ownerobj))))
(setq Alignment (vla-get-Alignment Ownerobj)
Backward (vla-get-Backward Ownerobj)
ObliqueAngle (vla-get-ObliqueAngle Ownerobj)
Rotation (vla-get-Rotation Ownerobj)
TextAlignmentPoint (vla-get-TextAlignmentPoint Ownerobj)
TextGenerationFlag (vla-get-TextGenerationFlag Ownerobj)
UpsideDown(vla-get-UpsideDown Ownerobj)
TrueColor (vla-get-TrueColor Ownerobj)
)
(vla-put-Alignment att Alignment)
(vla-put-Backward att Backward)
(vla-put-ObliqueAngle att ObliqueAngle)
(vla-put-Rotation att Rotation)
(VL-CATCH-ALL-APPLY 'vla-put-TextGenerationFlag (list att TextGenerationFlag))
(vla-put-Alignment att Alignment)
(vla-put-UpsideDown att UpsideDown)
(vla-put-TrueColor att TrueColor)
(VL-CATCH-ALL-APPLY ‘vla-put-TextAlignmentPoint (list att (vlax-3d-point (mapcar '+ inspt (vlax-safearray->list (vlax-variant-value TextAlignmentPoint))))))
)
(vla-put-Rotation obj rot)
(vla-put-XScaleFactor obj XScale)
(vla-put-yScaleFactor obj yScale)
(vla-put-zScaleFactor obj zScale)
)
)
)
(defun gxl-CatchApply (fun args / rtn )
(if
(not
(vl-catch-all-error-p
(setq rtn
(vl-catch-all-apply (function fun) args)
)
)
)
rtn
)
)
;;;属性复位 编制 Gu_xl 2011.05.15
(defun c:initatt ()
(while (setq ss (ssget '((0 . "insert"))))
(setq n (sslength ss))
(repeat n
(gxl-blk-att2init (ssname ss (setq n (1- n))))
)
)
(princ)
)
总结如下:
1,各种方案链接如下
1.1 坛友,取之于明, http://bbs.mjtd.com/thread-189253-1-1.html 博客园 https://www.cnblogs.com/JJBox/p/10226119.html
1.2代码方案
1.3 12代cpu问题
1.4 几百年前的方案都写了几百年了https://www.cnblogs.com/JJBox/p/10226119.html
1.5 其他或是字体问题?
2, 这种情况我用的是选择全部类似属性块,然后移动0.001后就可以,是否不需要代码?
如何解决发布打印时,保证文字不跑位问题?而不是打开之后,再用程序调整或者换字体解决?
3,感谢诸位,元宵节快乐!
属性块文字跑位问题2020版本
属性块文字跑位问题2020版本附件求解
看了半天没看懂你什么东西跑了 【求助】CAD2023怎么经常文字会变,然后点击一下又恢复 - AutoCAD 2024 下载及新功能 - AutoCAD论坛 - 明经CAD社区 - Powered by Discuz!http://bbs.mjtd.com/thread-189253-1-1.html 我用浩辰打开正常,不会变 我用浩辰打开正常,不会变的 有无定论,非人云亦云? 试了改字体,2020cad打开,好像可行
附图
页:
[1]
2