×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Lisp Routine

Lisp Routine

Lisp Routine

(OP)
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.

RE: Lisp Routine

Is the text height non-zero for the default text style in drawings you did not create?

RE: Lisp Routine

(OP)
The routine prompts for text height, hence non-zero text height.

RE: Lisp Routine

If your current style has a fixed height, an error will occur.

RE: Lisp Routine

It's might better to write:
(setvar "textsize" txth1)
(command ".text" pt1 0 n2)

RE: Lisp Routine

(OP)
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">: 0
Enter text: 56

Is there a way to ensure that the prompt sequence is the same given any drawing.

RE: Lisp Routine

The current text style has a FIXED text height.  Set it to 0 and the TEXT command will prompt for height.

RE: Lisp Routine

(OP)
Thanks CADaver you have made my day.
Thank you all for the support you gave me.

RE: Lisp Routine

Hi...

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

Add the following thing to the routine:

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

Un saludo de SpeedCAD... :)
CHILE

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources