Hello??
I'm in problem to draw offset in different distance like this example
This is just example
I hope to draw squares or lines over about 10,000 ...
So I need to know how to draw offset in different distance automatically..
I searched a lot.. but I can't find good solution to solve this.
My autocad version is 2014... So I can't use good apps that can be useful for offset..
Do you have any idea?
Solved! Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
Hi,
why opening a new (3rd) thread for the same question, please stay in the thread where you already have suggestions, ideas, and a communication with others.
Creating a new thread only means more work for all of us ... you too.
Please stay and continue >>>here<<<
- alfred -
Hi,
>> I thought my post was deleted...
Posts here are never deleted (as long as they match with general forum rules).
- alfred -
Hi,
>> I searched a lot.. but I can't find good solution to solve this.
True ... and you won't find,especially after three or four posts that goes around the same issue . So i suggest to mange well your time and start your drawing . 🙂
Imad Habash
Well, it's not that difficult to program, 20-30 mins.
(vl-load-com) (defun c:OffsetMultipleFile ( / *error* file lst line ss i o el+ el- ar+ ar- +/-) (defun *error* (errmsg) (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end")) (princ (strcat "\nError: " errmsg))) (if file (close file)) (princ)) ; -------------------------------------------------------------------- (if (setq file (open (strcat "c:\\Users\\OffsetMultipleFile.txt") "r")) ;; se file name (while (setq line (read-line file)) (setq lst (cons (atof line) lst)))) (if (setq ss (ssget "_:L" '((0 . "LWPOLYLINE,CIRCLE,ARC")))) (repeat (setq i (sslength ss)) (setq o (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (if (vl-catch-all-error-p (setq el+ (vl-catch-all-apply 'vla-offset (list o (car lst))))) (setq el+ nil)) (if (vl-catch-all-error-p (setq el- (vl-catch-all-apply 'vla-offset (list o (- (car lst)))))) (setq el- nil)) (if (setq +/- (cond ((and el+ (not el-)) +) ((and (not el+) el-) -) ((not (and (not (vl-catch-all-error-p (setq ar+ (vl-catch-all-apply 'vla-get-area (list el+))))) (not (vl-catch-all-error-p (setq ar- (vl-catch-all-apply 'vla-get-area (list el-))))))) nil) ((> ar+ ar-) +) ((< ar+ ar-) -) (T nil))) (foreach d lst (vla-offset o (+/- d)))) (vl-catch-all-apply 'vla-delete (list el+)) (vl-catch-all-apply 'vla-delete (list el-)) )) (princ) )
File: offset from the original object per line.
Thanks for your reply..
Actually,, I solved this problem during weekend without that code you wrote.
I appreciate many comment here including you.
Thinking of other ways to solve this problem, I found it way using an coordinate..
I used copy function not offset..
I didn't know I can use copy function to make copies in the desired multi point that I commented as multiple offset.
It made my work easy
By the way,, How could I learn programming for autocad?
I heard this is called VBA... right?
Thank you for every one.
Can't find what you're looking for? Ask the community or share your knowledge.