Jump to content

Recommended Posts

Posted (edited)

Hi Everyone,

 

I found this great lisp made by Bill Kramer, but I cant figure out the code to move the columns into the right position.  I'm attaching a screen shot of the table I would like to get & that is in the clouded area.  The table below that is the one being produced with the code attach.  I have several uses for this code and would like to know how to change locations of columns and to add n subtract as needed; also to add a specific table style to be used.

 

Thank
Joey G

 

(Defun c:FFEXT (/ at>att at>item at>set atable cnt cw ena nc nr pt rh)
   (vl-load-com)
   ;; GET_ATTS BY BILL KRAMER
   (defun get_ATTS (EN / EL ATTS)
(setq EL (entget EN))
(setq ENA (cdr (assoc 2 EL))) ; wiz
(if (and (= (cdr (assoc 0 EL)) "INSERT")
	 (= (cdr (assoc 66 EL)) 1)
    ) ;_ end and
    (progn
	(setq EN (entnext EN)
	      EL (entget EN)
	) ;_ end setq
	(while (= (cdr (assoc 0 EL)) "ATTRIB")
	    (setq ATTS (cons (list
				 (vla-get-ObjectID
				     (vlax-ename->vla-object EN)
				 ) ; wiz
				 (cdr
				     (assoc 2 EL)
				 ) ;_ end_cdr
				 (cdr (assoc 1 EL))
			     ) ;_ end_list
			     ATTS
		       ) ;_ end_cons
		  EN   (entnext EN)
		  EL   (entget EN)
	    ) ;_ end setq
	) ;_ end while
	(list ena (reverse ATTS)) ; wiz
    ) ;_ end progn
) ;_ end if
   ) ;_ end_defun
   (if	(setq at>set (ssget '((0 . "INSERT"))))
(progn
    (setq at>att
	     (mapcar 'get_atts
		     (vl-remove-if
			 'listp
			 (mapcar 'cadr (ssnamex at>set))
		     ) ;_ end_vl-remove-if
	     ) ;_ end_mapcar
    ) ;_ end_setq
    (setq PT (getpoint "\nTable insertion point: ")
	  RH (* 2.0 (getvar "TEXTSIZE"))
	  CW (* 20.0 (getvar "TEXTSIZE"))
	  NR (+ 2 (length at>att))
	  NC (1+ (length (cadar at>att)))
    ) ;_ end_setq
    (setq
	aTable (vla-addtable
		   (vla-get-modelspace
		       (vla-get-activedocument
			   (vlax-get-acad-object)
		       ) ;_ end_vla-get-activedocument
		   ) ;_ end_vla-get-modelspace
		   (vlax-3d-point PT)
		   NR
		   NC
		   RH
		   CW
	       ) ;_ end_vla-addtable
    ) ;_ end_setq
    (vla-setcellvalue aTable 0 0 "FF_01 / SQ. EDGE / POPLAR")
    (vla-setcellvalue aTable 1 1 "FACEFRAME")
    (vla-setcellvalue aTable 1 2 "COUNT")
    (vla-setcellvalue aTable 1 3 "PARTNAME")
    (vla-setcellvalue aTable 1 4 "FFTHK")
    (vla-setcellvalue aTable 1 5 "WIDTH")
    (vla-setcellvalue aTable 1 6 "LENGTH")
    (setq CNT 2) ;_ end_setq
    (foreach Item at>att
	(vla-setcellvalue aTable CNT 0 (car Item))
	(setq at>item 1)
	(while (<= at>item (length (cadar at>att)))
	    (vl-catch-all-apply
		'(lambda ()
		     (vla-settext
			 aTable
			 CNT
			 at>item
			 (strcat
			     "%<\\AcObjProp Object(%<\\_ObjId "
			     (itoa (car (nth (1- at>item) (cadr Item))))
			     ">%).TextString>%"
			 ) ;_ end_strcat
		     ) ;_ end_vla-setcellvalue
		 ) ;_ end_lambda
	    ) ;_ end_vl-catch-all-apply
	    (setq at>item (1+ at>item))
	) ;_ end_while
	(setq CNT (1+ CNT))
	;;ready next row
    ) ;_ end_foreach
) ;_ end_progn
   ) ;_ end_if
   (princ)
) ;_ end_Defun

 

FF.JPG

Edited by JoeyG_77
Add info

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