HI
I'm looking for a code for inserting a block and make the Attribute depend of a existing Attribute (see the attached dwg).
I have several problems:
1 - Why is there a grey shadow?
2 - How can a eliminate the not needed text " \W0.7000; ".
3 - With the code I also want to automatically change the layer of the existing block to an not printed layer I have.
Thanks for help
Solved! Go to Solution.
Solved by Ranjit_Singh2. Go to Solution.
Solved by paullimapa. Go to Solution.
Grey Shadow is AutoCAD's way of telling you that this object is a FIELD. To turn this feature off, set FIELDDISPLAY to 0
Perhaps others can jump in on solving FIELDS displaying the \W0.7000 code when Attributes are Multiline?
Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store
@paullimapa wrote:
............FIELDS displaying the \W0.7000 code when Attributes are Multiline?
Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store
That is coming from OPs text style that was used to define the blocks. It has a width factor applied to it. OP needs to edit the existing block to use a different text style.
I found this code, this one makes nearly that what i'm looking for...
Any Idea?
;;; By Jimmy Bergmark (defun Get-ObjectIDx64 (obj / util) (setq util (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object)))) (if (= (type obj) 'ENAME)(setq obj (vlax-ename->vla-object obj))) (if (= (type obj) 'VLA-OBJECT) (if (> (vl-string-search "x64" (getvar "platform")) 0) (vlax-invoke-method util "GetObjectIdString" obj :vlax-False) (rtos (vla-get-objectid obj) 2 0) ) ) ) (defun c:AT (/ entObject entObjectID InsertionPoint ad) (vl-load-com) (setq entObject (vlax-ename->vla-object(car (entsel))) entObjectID (Get-ObjectIDx64 entObject) InsertionPoint (vlax-3D-Point (getpoint "Einfügepunkt Text angeben: ")) ad (vla-get-ActiveDocument (vlax-get-acad-object)) ) (vla-addMText (if (= 1 (vla-get-activespace ad)) (vla-get-modelspace ad) (if (= (vla-get-mspace ad) :vlax-true) (vla-get-modelspace ad) (vla-get-paperspace ad) ) ) InsertionPoint 0.0 (strcat "%<\\AcObjProp Object(%<\\_ObjId " entObjectID ;;;">%).Area \\f \"%pr2%lu2%ct4%qf1 SQ. FT.\">%" ">%).Area \\f \"" "%pr2%lu6%qf1%ps[,m²]%ct8[1e-4]""\">%" )) )
Can't find what you're looking for? Ask the community or share your knowledge.