Jump to content

Recommended Posts

Posted

Hello,

 

I have a lisp which writes MTEXT in different scales.

 

It looks like this

 

(defun C:MTEXT5 (/ oldlay)
 (setq oldlay (getvar "clayer"))
 (vl-load-com)
 (setvar "cmdecho" 0)
 (if (not (tblsearch "LAYER" "A-------T2-------B"))
           (command "-layer" "M" "A-------T2-------B" "C" "red" "A-------T2-------B" "")
           (setvar "clayer" "A-------T2-------B")
           ) ; end if
   (Describe)  
 (setvar "cmdecho" 0) 
(load "K:\\CAD\\AIX-meny-2008\\Lisp\\text\\TextVariables.lsp")
(RegularText)
(text5)
(setvar "cmdecho" 1)
(setq PT1 (getpoint "\n First Point :"))
(setq PT2 (getcorner PT1 "\n Second Point :"))
 (initdia)
(command "mtext" PT1 PT2)
(setvar "clayer" oldlay)
 
 ); end 

 

In the same file you have 20 such copies of those rows.

The difference is (text5). I get the variable from another lisp and load only the textsize.

 

Now...

Every single (textX) works except for one.

 

The command MTEXT10 which have (text10) function.

 

If I executeit via my mnu-file (my menu) it returns this:

error: bad argument type: point: nil

 

When I type the command in the command: prompt it works...

Really strange .. why is that so?

Posted

Could be a problem just inbuilt in the text10 function - if you could post this separate function I could see if there was something wrong?

Posted


(defun RegularText ()
 (if (not (tblsearch "style" "AIX_ISO"))
   (C:AIXTXT)
))

(defun text5 ()
(command ".style" "" "" "15" "" "" "" "")
)
(defun text10 ()
(command ".style" "" "" "30" "" "" "" "")
)

 

It all worked before ..

Suddenly it stopped :)

And only for the mtext10 command.

mtext1 to mtext200 is working alltight.

 

mtext10 works only from the command: not from the menu.

Posted

Hmmm... that is weird.. if it works for text5 and not text10 - they look almost identical (apart from the 30 obviously).

 

Well, its hard to tell what can be going wrong, but I would recommend localising your variables.

 

The error thats occurring indicates to me that one of your point selections is nil when using the mtext, so I would localise the pt1 pt2 so that no other values are carried over when the function is repeated.

 

But I can't really see what else could go wrong... :(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...