vla-put-textstring changes alignment/insertion point of attritte text... help!

vla-put-textstring changes alignment/insertion point of attritte text... help!

Anonymous
Not applicable
7,849 Views
20 Replies
Message 1 of 21

vla-put-textstring changes alignment/insertion point of attritte text... help!

Anonymous
Not applicable

I am using the (vla-put-textstring obj val).

I am noticing that this is have unintended affects besides just updating the text.

Actually it is NOT changing the insertion point automatically based on the text it is given as input.

 

Before command:

before_change.PNG

 

 

After running vla-put-textstring on this object:

after_change.PNG

 

The entity data is a little weird:

Initial value of attribute:
((-1 . <Entity name: 7ffffb22cb0>)
  (0 . "ATTRIB")
  (330 . <Entity name: 7ffffb22ca0>)
  (5 . "4843")
  (100 . "AcDbEntity")
  (67 . 0)
  (410 . "Model")
  (8 . "DESC")
  (100 . "AcDbText")
  (10 2.25534 19.875 0.0)
  (40 . 0.125)
  (1 . "WRONG TEXT")
  (50 . 0.0)
  (41 . 0.7)
  (51 . 0.0)
  (7 . "WD")
  (71 . 0)
  (72 . 2)
  (11 3.0 19.875 0.0)
  (210 0.0 0.0 1.0)
  (100 . "AcDbAttribute")
  (280 . 0)
  (2 . "DESC1")
  (70 . 0)
  (73 . 0)
  (74 . 0)
  (280 . 0)
)

After running command:
((-1 . <Entity name: 7ffffb22cb0>)
  (0 . "ATTRIB")
  (330 . <Entity name: 7ffffb22ca0>)
  (5 . "4843")
  (100 . "AcDbEntity")
  (67 . 0)
  (410 . "Model")
  (8 . "DESC")
  (100 . "AcDbText")
  (10 2.25534 19.875 0.0)
  (40 . 0.125)
  (1 . "TEST 1")
  (50 . 0.0)
  (41 . 0.7)
  (51 . 0.0)
  (7 . "WD")
  (71 . 0)
  (72 . 2)
  (11 3.0 19.875 0.0)
  (210 0.0 0.0 1.0)
  (100 . "AcDbAttribute")
  (280 . 0)
  (2 . "DESC1")
  (70 . 0)
  (73 . 0)
  (74 . 0)
  (280 . 0)
)

 

This is an autocad electrical dwg, "edit component" is a built in command. My point being that the dxf 10 code never changes when I use the entmod method of changing this attribute text, but of course, I need to use active-x to do this change.

After edit component:
((-1 . <Entity name: 7ffffb22cb0>)
  (0 . "ATTRIB")
  (330 . <Entity name: 7ffffb22ca0>)
  (5 . "4843")
  (100 . "AcDbEntity")
  (67 . 0)
  (410 . "Model")
  (8 . "DESC")
  (100 . "AcDbText")
  (10 2.62156 19.875 0.0)
  (40 . 0.125)
  (1 . "TEST 1")
  (50 . 0.0)
  (41 . 0.7)
  (51 . 0.0)
  (7 . "WD")
  (71 . 0)
  (72 . 2)
  (11 3.0 19.875 0.0)
  (210 0.0 0.0 1.0)
  (100 . "AcDbAttribute")
  (280 . 0)
  (2 . "DESC1")
  (70 . 0)
  (73 . 0)
  (74 . 0)
  (280 . 0)
)

 

 

I am having a hard time figure out exactly what is happening here.

0 Likes
7,850 Views
20 Replies
Replies (20)
Message 21 of 21

vladop
Collaborator
Collaborator

Thanks @dbroad.

I did it using ACAD Electrical API WD_DBX... functions.

 

(setq att_entet (wd_dbx_entget (vlax-vla-object->ename att) dwg_hdl))
(setq newedd (subst (cons 41 scale)(assoc 41 att_entet) att_entet))
(wd_dbx_entmod newedd dwg_hdl)
 
Code is used to change attribute width factor.
 
Vladimir
0 Likes