Jump to content

Need Autolisp For Blocks Co-ordinate


harshad

Recommended Posts

hi all good morning:)

i want my work to done fast so i want yours help. i have a rectangle footing block

i place it on along with boundary @4.572 c/c and make adjestment corner and edges

i want 5 points x & y co-ordinate of that footing 1) center co-ordinate of center of footing 2) point a

3) point b 3) point c 4) point d and that output

list in excle format, i attached dwg u study it

if any program OR AUTOLISP give me all that five co-ordinat in excel by selecting footing in order

i also attach excel file output should be like that excel

try u r best pls doo this need ful

THANKS

HARSHAD:)

SAM.zip

Link to comment
Share on other sites

Just a note. If you have an insert point and know the footing block's size and rotation, you can just use math to calc the points.

Link to comment
Share on other sites

I think that many can write such code, a simple, boring code. :|

On it nobody wishes it to write and spend 15 minutes... Try it, you will find *.csv file with the same name in a folder with the drawing. Open it in MS Excel...

 

(defun c:bord(/ oldI cBl cDxf iPt rAn cStr fVar
        pt1 pt2 pt3 pt4 *error*)
 
 (defun *error*(msg)
   (if fVar(close fVar))
   (princ)
   ); end of *error*
 
 (if(not bord:i)(setq bord:i 1))
 (setq oldI bord:i
       bord:i(getint
   (strcat "\nSpecify first number <"
	   (itoa bord:i) ">: "))
fVar(open(strcase(strcat(getvar "DWGPREFIX")
			 (getvar "DWGNAME") ".csv")) "a")
); end setq
 (if(null bord:i)(setq bord:i oldI))
 (while T
   (if
     (and
       (setq cBl(entsel(strcat "\nPick foot <"
			(itoa bord:i) "> or Esc to Quit > ")))
       (equal(cons 2 "FOOTING TYPE-1")
       (assoc 2(setq cDxf(entget(car cBl)))))
); end and
     (progn
(setq iPt(cdr(assoc 10 cDxf))
      rAn(cdr(assoc 50 cDxf))
      pt1(polar iPt(+ rAn(angtof "120.4655449167164" 0)) 0.9861541463877346)
      pt2(polar iPt(+ rAn(angtof "59.53445509597224" 0)) 0.9861541463877346)
      pt3(polar iPt(+ rAn(angtof "300.4655449294050" 0)) 0.9861541463877346)
      pt4(polar iPt(+ rAn(angtof "239.5344550891135" 0)) 0.9861541463877346)
      cStr(strcat(itoa bord:i)
		 ";" (rtos(car iPt)2 4) ";" (rtos(cadr iPt)2 4)
		 ";" (rtos(car pt1)2 4) ";" (rtos(cadr pt1)2 4)
		 ";" (rtos(car pt2)2 4) ";" (rtos(cadr pt2)2 4)
		 ";" (rtos(car pt3)2 4) ";" (rtos(cadr pt3)2 4)
		 ";" (rtos(car pt4)2 4) ";" (rtos(cadr pt4)2 4)
	  ); end strcat
      bord:i(1+ bord:i)
      ); end setq
(write-line cStr fVar)
); end progn
     (princ "\n<!>This isn't 'FOOTING TYPE-1' block <!> ")
     ); end if
   ); end while
 (princ)
 ); end of c:bord

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