Author Topic: Routine stopped working....  (Read 2470 times)

0 Members and 1 Guest are viewing this topic.

bman

  • Guest
Routine stopped working....
« on: January 27, 2005, 09:45:10 AM »
The following routine was working fine 2 weeks ago & now all the sudden it's giving me the following error & I can't seem to fix it:

Select upper elevation: ; error: no function definition: MAKEX

Code: [Select]
(defun c:Slo (/ ocmd ent1 uelev lelev lng1 txts ang1)
(command "_.undo" "_end")
(command "_.undo" "_group")
(setq clay (getvar "clayer"))
(setq ocmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq ent1 (entsel "\nSelect upper elevation: "))
(if ent1
(progn
(setq ent1 (makex (car ent1)))
(setq uelev (getx ent1 'TextString))
)
)
(setq ent1 (entsel "\nSelect lower elevation: "))
(if ent1
(progn
(setq ent1 (makex (car ent1)))
(setq lelev (getx ent1 'TextString))
)
)
(setvar "osmode" 617)
;;;;;;;;;;;(command "-layer" "s" "dra-breakline" "")
(prompt "\nEnter point(s): ")
(command "_.pline")
(while (> (getvar "cmdactive") 0)
(command pause)
)
(setq ent1 (makex (entlast)))
(setq lng1 (getx ent1 'Length))
(if (and uelev lelev lng1)
(progn
(setq txts (* (/ (- (atof uelev) (atof lelev)) lng1) 100))
(setq ang1
(rtd
(angle
(getpoint "\nSelect slope label angle (going left to right). ")
(getpoint "\nSelect end point of angle. ")
)
)
)
(prompt "\nSelect insertion point of slope text: ")
(if (> (cdr (assoc 40 (tblsearch "style" (getvar "textstyle")))) 0)
(command "_text" "j" "bc" pause ang1 (strcat(rtos txts 2 2)"%"))
(command "_text" "j" "bc" pause "" ang1 (strcat(rtos txts 2 2)"%"))
)
)
)
(command "-layer" "s" clay "")
(setvar "cmdecho" ocmd)
(command "_.undo" "_end")
(princ)
)

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Routine stopped working....
« Reply #1 on: January 27, 2005, 09:49:08 AM »
>error: no function definition: MAKEX
It means acad can't find that function/file, you need to find it and load it.
TheSwamp.org  (serving the CAD community since 2003)

bman

  • Guest
Routine stopped working....
« Reply #2 on: January 27, 2005, 10:42:55 AM »
I apploaded it & issued the "slo" command & it seems to be executing the routine....it even prompts for the "Select upper elevation:" line, but when I pick a text entity with an elevation value I keep getting this messsage:

error: no function definition: MAKEX

If it wasn't loaded I wouldn't have gotten that far...right?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Routine stopped working....
« Reply #3 on: January 27, 2005, 10:52:50 AM »
Quote
If it wasn't loaded I wouldn't have gotten that far...right?

Nope !!

In your code;
Code: [Select]

(setq ent1 (entsel "\nSelect upper elevation: "))
(if ent1
(progn
(setq ent1 (makex (car ent1)))
(setq uelev (getx ent1 'TextString))
)

you'll see the first call to makex is right after that.

Look for a file called 'makex.lsp' or a file containing the text 'makex'. that is the file that needs to be loaded. You see your code is calling another function which appears to be in another file.
TheSwamp.org  (serving the CAD community since 2003)

bman

  • Guest
Routine stopped working....
« Reply #4 on: January 27, 2005, 01:56:20 PM »
found it!!! It was in another file that wasn't loaded just as you suggested. Thanks for your help.