excel command list input display text????

excel command list input display text????

Anonymous
Not applicable
1,318 Views
5 Replies
Message 1 of 6

excel command list input display text????

Anonymous
Not applicable

I use autocad 2014ver the input command list point display text (COMMAND"TEXT""J""bc""812631.354936753,824937.620605355,0"0.2"""4.939")

why not update 2017 ver

 

 

please find attached file

 

thanks

 

gary

 

96567508

0 Likes
1,319 Views
5 Replies
Replies (5)
Message 2 of 6

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

Tried your LISP statement with AutoCAD 2017 and it worked (well, I modified it to have spaces between quotes)

 

(COMMAND"TEXT" "J" "bc" "812631.354936753,824937.620605355,0" 0.2 "" "4.939")

 

What exactly does not work? What info do you get the commandline?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 6

leeminardi
Mentor
Mentor

Make sure the default text size is zero.  There is one less parameter to the text command when the default text size is greater than zero so this can screw up the text command string.

 

~Lee

lee.minardi
0 Likes
Message 4 of 6

Kent1Cooper
Consultant
Consultant

@lminardigmail wrote:

Make sure the default text size is zero.  ....


That's perhaps misleading wording....  I would interpret the "default text size" as being the value in the TEXTSIZE System Variable, which is the default height offered in Text commands when the current Style is defined with 0 height.  [The TEXTSIZE value is irrelevant when the current Style has a non-0 defined height -- there is no height prompt in the Text command.]  But TEXTSIZE cannot be set to 0, for obvious reasons.

 

Since your Text commands contain an answer to the height prompt, you need to make sure the defined height of the current Text Style is 0.  You can build in a Style option in the Text commands to make sure it uses a specific 0-height Style, so that it will not be affected by what the current Style may be when you start.  Or you can start the whole process off a -STYLE command or (setvar 'textstyle "YourZeroHeightStyleName"), to set that before any Text commands occur.

Kent Cooper, AIA
0 Likes
Message 5 of 6

Anonymous
Not applicable
(if (= 0.0 (cdr (assoc 40 (tblsearch "Style" (getvar "textstyle")))))
  (command "TEXT" "J" "bc" "812631.354936753,824937.620605355,0" (getvar "textsize") "" "4.939")
  (command "TEXT" "J" "bc" "812631.354936753,824937.620605355,0" 0.2 "" "4.939")
)

This will test if the current text style has a height of 0, if so it uses the current textsize, otherwise it uses 0.2 text height

 

0 Likes
Message 6 of 6

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
(if (= 0.0 (cdr (assoc 40 (tblsearch "Style" (getvar "textstyle")))))
  (command "TEXT" "J" "bc" "812631.354936753,824937.620605355,0" (getvar "textsize") "" "4.939")
  (command "TEXT" "J" "bc" "812631.354936753,824937.620605355,0" 0.2 "" "4.939")
)

This will test if the current text style has a height of 0, if so it uses the current textsize, otherwise it uses 0.2 text height

 


That's not it, because if the current Text Style has a non-zero defined height, there will be no prompt for the height to which that 0.2 would be the answer.  So it will use 0.2 to answer the rotation-angle prompt that will be waiting at the time, and "" for the content, and "4.939" will cause an unknown-command error.

 

Also, if you want to use the current TEXTSIZE setting when the current Style has no fixed height, you don't need to extract the value of the System Variable, but can simply use Enter [""], because it will be the default that is offered.

 

It's hard for me to believe that the OP would really want to do this and take whatever happens to be the current Text Style, rather than specifying a particular one, unless they actually never use more than one Style in any drawing or this is part of something larger that sets the Style, and the Style is always defined with zero height.  But if that's really what they want to do, and there might be some Styles with defined heights and some without, and they want the 0.2 height if the current Style doesn't have a fixed one of its own, I would go about it this way, eliminating a lot of redundancy, since most of the command is the same either way:

 

(command "TEXT" "J" "bc" "812631.35,824937.62,0")
(if (= 0.0 (cdr (assoc 40 (tblsearch "Style" (getvar "textstyle")))))
  (command 0.2 "" "4.939"); then -- use 0.2 in original
  (command "" "4.939"); else -- no height prompt to be answered
)

 

[I also shortened the rather astonishing 9-digit precision in the X & Y coordinates, but that's not necessary.]

Kent Cooper, AIA
0 Likes