Message 1 of 11
vla-put-tagstring problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All
need a little bit of help here
Trying to modify the attribute tag name via vla-put-tagstring
the following code does everything I want it to do, except the vla-put-tagstring
Actually it removes the attribute prompt (please see screendumps)
I must be overlooking something basic
Please don't tell me that the code looks awful, I know 😓, it is not optimized, just tried to divide it up into every possible single piece to see what is going wrong
(vlax-for obj
(vla-item (vla-get-Blocks (vla-get-Document blockobj))
(if (vlax-property-available-p blockobj 'EffectiveName)
(vla-get-EffectiveName blockobj)
(vla-get-Name blockobj)
)
)
(if (eq "AcDbAttributeDefinition" (vla-get-ObjectName obj))
(progn
(setq Blk_Tag (vla-get-TagString obj))
(setq Blk_XYZ (vlax-safearray->list (vlax-variant-value (vla-get-insertionpoint obj))))
(setq Blk_Prm (vla-get-PromptString obj))
(setq Blk_X (rtos(car Blk_XYZ) 2 0 ))
(setq Blk_Y (rtos(cadr Blk_XYZ) 2 0 ))
(princ "Blk_Tag = ")(princ Blk_Tag)(princ "\t")(princ "Blk_X = ")(princ Blk_X)(princ "\t")(princ "Blk_Y = ")(princ Blk_Y)(princ "\t")(princ "Blk_Prm = ")(princ Blk_Prm)(princ "\n")
(foreach line Exl_Attrib_Info
(if (/= (car line) "Column1")
(progn
(setq Exl_Tag (nth 0 line))
(setq Exl_Prm (nth 1 line))
(setq Exl_X (nth 2 line))
(setq Exl_Y (nth 3 line))
(setq Exl_NewTag (nth 4 line))
(if (and ( = Blk_tag Exl_Tag)
( = Blk_Prm Exl_Prm)
( = Blk_X Exl_X)
( = Blk_Y Exl_Y))
(progn
(princ "found correct settings \t")(princ "Old Prompt = ")(princ Blk_Prm)(princ "\t")(princ "New Tag Will be = ")(princ Exl_NewTag)(princ "\n")
(setq result (vla-put-tagstring obj Exl_NewTag))
(princ "result = ")(princ result)(princ "\n")
))
))
)
))
;
)
(the variable Exl_Attrib_Info comes from an excel file and is correct)
thanks in advance
Patrick