Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lisp Routine

Status
Not open for further replies.

tendai1

Structural
Mar 29, 2003
24
If I run a lisp which inserts text i.e. (command ".text" pt1 txth1 0 n2) in a certain drawing, Only 0 (zero) is inserted for all the points I require, yet my expected results should be say 56 57 or 58.
If I run the same routine on drawings which I created i get the right answer. Is there a system variable which needs to be set to ensure that zero results are elliminated. I will provide the lisp and drawing if you like it for examination.
 
Replies continue below

Recommended for you

Is the text height non-zero for the default text style in drawings you did not create?
 
The routine prompts for text height, hence non-zero text height.
 
If your current style has a fixed height, an error will occur.
 
It's might better to write:
(setvar "textsize" txth1)
(command ".text" pt1 0 n2)
 
I have analysed the (command ".text")'s prompt sequence for the different drawings. On all of my drawings the sequence is as follows:

Specify start point of text or [Justify/Style]:
Specify height <0.300>: .3
Specify rotation angle of text <0.00>:
Enter text: 56

Whereas this other drawing prompts as follows:

Specify start point of text or [Justify/Style]:
Specify rotation angle of text <0d30'0&quot;>: 0
Enter text: 56

Is there a way to ensure that the prompt sequence is the same given any drawing.
 
The current text style has a FIXED text height. Set it to 0 and the TEXT command will prompt for height.
 
Thanks CADaver you have made my day.
Thank you all for the support you gave me.
 
Hi...

Problem is easy to solve you, you must do the following thing:

Add the following thing to the routine:

(setq fntfuente (getvar &quot;textstyle&quot;))
(setq lst-fntfuente (tblsearch &quot;STYLE&quot; fntfuente))
(if (= 0.0 (cdr (assoc 40 lst-fntfuente)))
(progn
(setq txth1 3.5)
(command &quot;_.text&quot; pt1 txth1 0 n2)
)
(progn
(command &quot;_.text&quot; pt1 0 n2)
)
)

Un saludo de SpeedCAD... :)
CHILE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor