Jump to content

function canceled


anishtain4

Recommended Posts

In a big lisp file I'm trying to use dtext command as follow:

 

(vl-cmdf "dtext" "m" mypt myht rog )

 

when I try it in console it's fine, but when i debug the lisp file this line triggers *error* with "function canceled message". I have watched all the arguments, they are say as:

 

(setq mypt '(3.2 4.8 0.0) myht 0.04 rog "0")

 

I was facing similar problem with (command) but when I changed it to (vl-cmdf) it worked well. Does anyone have a experience with such problems?

 

PS: googling results in reactors

Link to comment
Share on other sites

I don't have a reactor at all, I merely mentioned that google search leads to reactor issues not my problem.

 

The code has become so big and it needs some files to run, that is why I don't share it.

Link to comment
Share on other sites

Try this:

(command "_.text" "_non" mypt)
(if (zerop (cdr (assoc 40 (tblsearch "STYLE" (getvar 'textstyle)))))
   (command myht)
)
(command rog)

Link to comment
Share on other sites

what comes after this line?

 

(vl-cmdf "dtext" "m" mypt myht rog )

 

As you said "it worked well" so its another line that generates that error.

Link to comment
Share on other sites

I stripped down the whole project to some files. Extract the folder in c: and load them. Put a break point in line 119 of kateb.lsp then run the program. Type the first line as you please (probably that would be non-sense to you since it's non-english). Press "continue" for repeating the loop and getting back to the same line, now the function (command "dtext" "m" mypt myht rog) ) triggers the *error* with message "function cancelled".

 

I checked all the variables to see if I have mistakenly changed anything somewhere else? But no clue.

 

Do you know what is wrong?

shareframe.zip

Link to comment
Share on other sites

what comes after this line?

 

(vl-cmdf "dtext" "m" mypt myht rog )

 

As you said "it worked well" so its another line that generates that error.

It worked well somewhere else, so I guessed it might help here but I was wrong.

It returns nil which obviously is a malfunction to my code.

Link to comment
Share on other sites

I don't know if this has anything to do with it, but are you confusing right and left in the program?

 

What do you mean by that? I don't have any problem regarding to direction but only the second type it wants to output a text, function cancels and I don't know why?

Link to comment
Share on other sites

What do you mean by that? I don't have any problem regarding to direction but only the second type it wants to output a text, function cancels and I don't know why?
I meant this in regard to text justification--"r" for "right", and left justified is the default. I think you may need to check the program for this, as it seemed to be backward in at least one place; unless right justified is somehow the default for your AutoCAD installation.
Link to comment
Share on other sites

pBe: There is the simplified version of the routine, it is supposed to write text in special places on screen (the array frmtxt). Since it may be repeated in a single cad file or among different documents values typed should be saved either in a text file or variables to be used later as default text.

 

neophoible: text justification is not the issue; text should be backward which makes left to be right and vice versa. Text would be Persian (right to left writing direction). I don't believe that is what causing the problem.

 

to reproduce the error check post #7

Edited by anishtain4
Link to comment
Share on other sites

text justification is not the issue; text should be backward which makes left to be right and vice versa. Text would be Persian (right to left writing direction). I don't believe that is what causing the problem.
I'll have to take your word for it. Since I've only dealt with AutoCAD using English, I am unfamiliar with how AutoCAD handles languages that work from right to left. From your program, it appears to treat right justified as the default, which, of course, is not the case for standard English installations. Interesting.
Link to comment
Share on other sites

Actually it's not that, to come along with right to left writings we use backward check, hence right would eventually result to left aligned and vice versa. Are you cool with it now?

You don't need a non-english installation just the shx file in post #7.

Link to comment
Share on other sites

Well, I thought I kind of understood, until you explained it more.:? Basically, I understand that you have to refer to right as left, and left as right, internally, which is what you are doing in your program. Given an RTL language, it makes sense. I enjoy learning new things, so thanks for all the info.

Link to comment
Share on other sites

It's really easy to try. Open autocad, make the command dt and write something. Then go in the properties of it and change backward to yes. You will see what happens. Since RTL scripting is not a part of autocad backward text makes LTR behave as RTL.

Got it now?

 

PS: I found the problem of the code. I should have changed the line:

(command "ddedit" txthandle)

to

(command "ddedit" txthandle "")

Link to comment
Share on other sites

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...