Message 1 of 4
Not applicable
12-06-2018
12:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello! I'm new to AutoLISP. Recently I had an assignment to write a function which draws a simple object. I've ran into a problem that this function performs correctly on some PCs but not on all of them. Here are the pictures when it's all good:
And here it is when it doesn't perform correctly (sorry for the bad quality on this one):
As you can see the above 3 figures got "malformed" and I have no idea why this is happening. I've tried reinstalling AutoCAD on the PC on which the function didn't work with no luck at all.
The code of the function looks something like this:
(DEFUN C:Figure1 () (SETQ PrTaskas (GETPOINT "\n Insert the starting coordinates:")) (SETQ Taskas1 (list (+ (car PrTaskas) 8) (cadr PrTaskas))) (SETQ Pradinis (GETREAL "\n Insert the starting width") ) (SETQ Galinis (GETREAL "\n Insert the end width" ) ) (COMMAND "pline" PrTaskas "Width" Pradinis Galinis Taskas1) (SETQ Taskas2 (list (car Taskas1) (+ (cadr Taskas1) 8))) (COMMAND Taskas2) (SETQ Taskas3 (list (+ (car Taskas2) -5) (cadr Taskas2))) (COMMAND Taskas3) (SETQ Taskas4 (list (car Taskas3) (+ (cadr Taskas3) -3))) (COMMAND Taskas4) (SETQ Taskas5 (list (+ (car Taskas4) -3) (cadr Taskas4))) (COMMAND Taskas5 *Cancel*) (COMMAND "pline" Taskas5 PrTaskas *Cancel*) (COMMAND "pline" Taskas3 Taskas5 *Cancel*) (SETQ L1 (list (+ (car PrTaskas) 1.6) (+ (cadr PrTaskas) 1))) (SETQ L2 (list (car L1) (+ (cadr L1) +3))) (COMMAND "pline" L1 L2 *cancel*) (SETQ L3 (list (+ (car PrTaskas) 3.2) (+ (cadr PrTaskas) 1))) (SETQ L4 (list (car L3) (+ (cadr L3) +3))) (command "pline" L3 L4 *cancel*) (SETQ L5 (list (+ (car PrTaskas) 4.8) (+ (cadr PrTaskas) 1))) (SETQ L6 (list (car L5) (+ (cadr L5) +6))) (command "pline" L5 L6 *cancel*) (SETQ L7 (list (+ (car PrTaskas) 6.4) (+ (cadr PrTaskas) 1))) (SETQ L8 (list (car L7) (+ (cadr L7) +6))) (command "pline" L7 L8) )Any help would be much appreciated!
Solved! Go to Solution.