I have the adoptation of a function suggested by a person in this forum and I have given the file his name. How can I get the 'princ' value in the command window?
The code is:
(defun x nil(setq r 2000);Fictitious value(setq r1 1500);Fictitious valur(while (> r r1) (setq devx 4.7); From previous calc. (setq ip '(707.7 432.2));From previous calc. (setq b -0.84);From previous calc. ;(setq ip(car (reverse lx))) (setq s 7);Given by user previously (setq v 120);Given by user previously (setq pr(polar ip devx 400)) (command "_line" "_non" ip "_non" pr) (while (> (getvar 'cmdactive) 0) (command "") (setq x (getpoint "\nGive nearest point to ip on curve"))); best location North of 706,321 on line ip pr for this case (setq del(abs b)) (setq a(/ del 2)) (setq tan(/ (sin a) (cos a))) (setq y(* tan tan)) (setq r(* (/ (distance ip x) y) (+ 1 (sqrt (+ 1 y))))) (setq s1(/ (* v v) (* r 2.828)));according to UK's TD 9 (cond ((and (< s1 s) (> s1 2.5)) (setq s s1))) (setq r1(/ (* v v) (* s 2.828))) (while (< r r1) (load "F:\Marko") (princ "\nRadius less than minimum, select point further from ip");This line appears only in text window (x) ) ))
Can anyone help please?
This can be run within 0,0 and 1300,900 limits.
Hi Stefan,
This code may be copied to a file wih .lsp extension and saved at location 'F' (in my case pendrive) with name Marko as a lisp file. It runs ok with point assigned to x. The program will load it and enter (x) on its own and does the rest as expected, only problem is that the text does not appear for the user to know what is happening.
I will try what you have suggested later.
Regards,
Aloy
Hi Stefan,
I tried what you suggested. When I hit the wrong place if gives the Strucat phrase, after that even if I hit the wrong place it accept the wrong value. Perhaps the code needs adjustment a bit and I do not know how.
Regards,
Aloy
aloy,
I would be glad to help you, only if I know what you want to do.
I tried to understand from your lisp but I gave up quickly.
All I understand is that if you pick a wrong point, the program reloads and starts over again and draw the same line in the same place.
A more complete and better explanation would help us to give you a proper solution.
Stefan,
I will give the problem as follows:
There are two lines p1, p2 and p3, p4. They intersect at ip. I am trying to fix an arc touching these two lines. For that, I draw a bisector of these lines passing through the center of the arc. I am trying to get a point, that suits certain criteria on that line. This is a typical problem I get in road alignment design. The arc should pass through an unrestricted area and also meet the minimum radius in conformity with restrictions of maximum superelivation and also consider speed. I believe the code I have given does all that except giving the princ value in the window for the user to see and take appropriate action. It however apears in the text window, which the user cannot see. If I select the wrong points the routine draws lines repeatedly whithout giving an indication what I should do.
Regards,
Aloy
I still can not test your function. I believe is just a piece of a larger routine, so I don't have the entire picture...
For this part, you may try to inhibit what (command "line" ... is prompting at execution time.
Use
defun x1 nil(setq r 2000);Fictitious value(setq r1 1500);Fictitious valur(while (> r r1) (setq devx 4.7); From previous calc. (setq ip '(707.7 432.2));From previous calc. (setq b -0.84);From previous calc. ;(setq ip(car (reverse lx))) (setq s 7);Given by user previously (setq v 120);Given by user previously (setq pr(polar ip devx 400)) (command "_line" "_non" ip "_non" pr) (while (> (getvar 'cmdactive) 0) (command "") (setq x (getpoint "\nRadius less than minimum, select point further from ip" ))) (setq del(abs b)) (setq a(/ del 2)) (setq tan(/ (sin a) (cos a))) (setq y(* tan tan)) (setq r(* (/ (distance ip x) y) (+ 1 (sqrt (+ 1 y))))) (setq s1(/ (* v v) (* r 2.828)));according to UK's TD 9 (cond ((and (< s1 s) (> s1 2.5)) (setq s s1))) (setq r1(/ (* v v) (* s 2.828))) (while (< r r1) (load "F:\Marko1") (x1) )))
Stefan,
Sorry it is not the name of the function, it is the file name of the file that was changed.
Also I need to inform what happened after I clicked the email sent by Adesk with your message. My computer got reset. Few hours later there was an international call out of the blue (as advised by adesk) giving me the price of Civil 3D. Very strange indeed.
Aloy
I'm very sorry to hear that.
I've just answered your post here at CADTutor, and you probably received an email informing you about it. But what does this have to do with Adesk?