anishtain4 Posted April 7, 2013 Share Posted April 7, 2013 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 Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 7, 2013 Share Posted April 7, 2013 Are you calling this or other Commands from within your Reactor code? Quote Link to comment Share on other sites More sharing options...
anishtain4 Posted April 7, 2013 Author Share Posted April 7, 2013 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 7, 2013 Share Posted April 7, 2013 Try this: (command "_.text" "_non" mypt) (if (zerop (cdr (assoc 40 (tblsearch "STYLE" (getvar 'textstyle))))) (command myht) ) (command rog) Quote Link to comment Share on other sites More sharing options...
anishtain4 Posted April 8, 2013 Author Share Posted April 8, 2013 Same result: Function cancelled Quote Link to comment Share on other sites More sharing options...
pBe Posted April 8, 2013 Share Posted April 8, 2013 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. Quote Link to comment Share on other sites More sharing options...
anishtain4 Posted April 8, 2013 Author Share Posted April 8, 2013 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 Quote Link to comment Share on other sites More sharing options...
anishtain4 Posted April 8, 2013 Author Share Posted April 8, 2013 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. Quote Link to comment Share on other sites More sharing options...
neophoible Posted April 8, 2013 Share Posted April 8, 2013 I don't know if this has anything to do with it, but are you confusing right and left in the program? Quote Link to comment Share on other sites More sharing options...
anishtain4 Posted April 9, 2013 Author Share Posted April 9, 2013 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? Quote Link to comment Share on other sites More sharing options...
pBe Posted April 9, 2013 Share Posted April 9, 2013 anishtain4 hope you don't mind me asking, what exactly does the routine supposed to do? Quote Link to comment Share on other sites More sharing options...
neophoible Posted April 9, 2013 Share Posted April 9, 2013 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. Quote Link to comment Share on other sites More sharing options...
anishtain4 Posted April 10, 2013 Author Share Posted April 10, 2013 (edited) 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 April 10, 2013 by anishtain4 Quote Link to comment Share on other sites More sharing options...
neophoible Posted April 10, 2013 Share Posted April 10, 2013 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. Quote Link to comment Share on other sites More sharing options...
anishtain4 Posted April 11, 2013 Author Share Posted April 11, 2013 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. Quote Link to comment Share on other sites More sharing options...
neophoible Posted April 11, 2013 Share Posted April 11, 2013 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. Quote Link to comment Share on other sites More sharing options...
anishtain4 Posted April 13, 2013 Author Share Posted April 13, 2013 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 "") Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.