Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/08/2022 in all areas

  1. 2 points
  2. mhupp

    D

    https://autolispprograms.wordpress.com/hvac/hvac-application/
    1 point
  3. Thank you @ronjonp for taking the time to post that link here, highly appreciated @Cadmando- you can review the latest version from my website which have more additions and options to the same program. https://autolispprograms.wordpress.com/hvac/hvac-application/
    1 point
  4. http://www.lee-mac.com/attributefunctions.html If you're lost way in Lisp, see the Lee Mac. he will point you to the right path with this code, you can get your block attributes in list. It is not difficult to extract this into Excel. ;; Extracting Block Attributes to Excel - 2022-04-08 exceed ;; https://www.cadtutor.net/forum/topic/74793-extract-attribute-selected-in-excel/ (vl-load-com) (defun c:EXATT ( / blk *error* ss ssl index ename blk lst rclist answer ) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\n Error: " msg)) ) (princ) ) (setq rclist (ex:ECADR)) (setq r (car rclist)) (setq r0 r) (setq c (cadr rclist)) (setq c0 c) (setq answer (getstring "\n enter here? ( space-bar(yes) / esc(no) )")) (setq ss (ssget '((0 . "insert")) ) ) (setq ssl (sslength ss)) (setq index 0) (repeat ssl (setq ename (ssname ss index)) (setq blk (vlax-ename->vla-object ename)) (setq lst (LM:vl-getattributevalues blk)) (setq lstlen (length lst)) (setq index2 0) (ex:ecsel r c) (ex:ecput (strcat "BLOCK" (vl-princ-to-string (+ index 1)))) (setq r (+ r 1)) (repeat lstlen (setq sublst (nth index2 lst)) (setq atxt (car sublst)) (setq btxt (cdr sublst)) (ex:ecsel r c) (ex:ecput btxt) (setq r (+ r 1)) (setq index2 (+ index2 1)) );end of repeat2 ;(princ lst) (setq r (- (- r index2) 1)) (setq c (+ c 1)) (setq index (+ index 1)) );end of repeat (setq r r0) (ex:ecsel r c) (princ) ) ;; Get Attribute Values - Lee Mac ;; Returns an association list of attributes present in the supplied block. ;; blk - [vla] VLA Block Reference Object ;; Returns: [lst] Association list of ((<tag> . <value>) ... ) (defun LM:vl-getattributevalues ( blk ) (mapcar '(lambda ( att ) (cons (vla-get-tagstring att) (vla-get-textstring att))) (vlax-invoke blk 'getattributes)) ) (defun ex:ECSEL ( r c / *error* excelapp workbooks sheets acsheet acsheetname captionname addr rng c1 c2 c3) (setvar "cmdecho" 0) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\n Error: " msg)) ) (vlax-release-object AcSheet) (vlax-release-object Sheets) (vlax-release-object Workbooks) (vlax-release-object ExcelApp) (setvar "cmdecho" 1) (princ) ) ;BIGAL's ah:chkexcel (if (= (setq excelapp (vlax-get-object "Excel.Application") ) nil) ; if open already (setq excelapp (vlax-get-or-create-object "Excel.Application")) ) (if (= (setq acsheet (vlax-get-property ExcelApp 'ActiveSheet)) nil) (vlax-invoke-method (vlax-get-property excelapp 'Workbooks) 'Add) ) (vlax-put Excelapp "visible" :vlax-true) (if (/= (setq captionname (vlax-get-property ExcelApp 'caption)) nil) (progn ;(princ "\n workbook name - ") ;(princ captionname) );end of progn ) (setq Workbooks (vlax-get-property ExcelApp 'Workbooks)) (setq Sheets (vlax-get-property ExcelApp 'Sheets)) (setq AcSheet (vlax-get-property ExcelApp 'ActiveSheet)) (setq acsheetname (vlax-get-property acsheet 'name)) (setq c (- c 1)) (cond ((and (> c -1) (< c 25)) (setq c1 (+ c 1)) (setq addr (strcat (chr (+ 64 c1)) (itoa r) ":" (chr (+ 64 c1)) (itoa r) )) );end of cond option 1 ((and (> c 24) (< c 702)) (setq c2 (fix (/ c 26))) (setq c1 (- c (* c2 26))) (setq c2 c2) (setq c1 (+ c1 1)) (setq addr (strcat (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r) ":" (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r))) );end of cond option 2 ((and (> c 701) (< c 18278)) (setq c3 (fix (/ c (* 26 26)) ) ) (setq c2 (fix (/ (- c (* c3 (* 26 26))) 26))) (setq c1 (- (- c (* (* c3 26) 26)) (* c2 26))) (setq c3 c3) (setq c2 c2) (setq c1 (+ c1 1)) (setq addr (strcat (vl-princ-to-string (chr (+ 64 c3))) (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r) ":" (vl-princ-to-string (chr (+ 64 c3))) (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r))) );end of cond option 3 );end of cond ;(princ " ( in address format ") ;(princ addr) ;(princ " )") (setq rng (vlax-get-property acsheet 'Range addr)) (vlax-invoke rng 'Select) (setvar "cmdecho" 1) (princ) ) (defun ex:ECPUT ( textstring / *error* excelapp workbooks sheets acsheet acsheetname accell cell r c captionname addr rng textstring2 textstring c1 c2 c3) (setvar "cmdecho" 0) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\n Error: " msg)) ) (vlax-release-object AcSheet) (vlax-release-object Sheets) (vlax-release-object Workbooks) (vlax-release-object ExcelApp) (setvar "cmdecho" 1) (princ) ) ;BIGAL's ah:chkexcel (if (= (setq excelapp (vlax-get-object "Excel.Application") ) nil) ; if open already (setq excelapp (vlax-get-or-create-object "Excel.Application")) ) (if (= (setq acsheet (vlax-get-property ExcelApp 'ActiveSheet)) nil) (vlax-invoke-method (vlax-get-property excelapp 'Workbooks) 'Add) ) (vlax-put Excelapp "visible" :vlax-true) (if (/= (setq captionname (vlax-get-property ExcelApp 'caption)) nil) (progn ;(princ "\n workbook name - ") ;(princ captionname) );end of progn ) (setq Workbooks (vlax-get-property ExcelApp 'Workbooks)) (setq Sheets (vlax-get-property ExcelApp 'Sheets)) (setq AcSheet (vlax-get-property ExcelApp 'ActiveSheet)) (setq acsheetname (vlax-get-property acsheet 'name)) (setq accell (vlax-get-property ExcelApp 'Activecell)) (setq cell (vlax-get-property acsheet 'Cells)) (setq textstring2 (strcat "'" textstring)) (setq r (vlax-get-property accell 'row)) (setq c (vlax-get-property accell 'column)) (setq c (- c 1)) (cond ((and (> c -1) (< c 25)) (setq c1 (+ c 1)) (setq addr (strcat (chr (+ 64 c1)) (itoa r) ":" (chr (+ 64 c1)) (itoa r) )) );end of cond option 1 ((and (> c 24) (< c 702)) (setq c2 (fix (/ c 26))) (setq c1 (- c (* c2 26))) (setq c2 c2) (setq c1 (+ c1 1)) ;(princ "c1 - ") ;(princ c1) ;(princ "c2 - ") ;(princ c2) (setq addr (strcat (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r) ":" (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r))) );end of cond option 2 ((and (> c 701) (< c 18278)) (setq c3 (fix (/ c (* 26 26)) ) ) (setq c2 (fix (/ (- c (* c3 (* 26 26))) 26))) (setq c1 (- (- c (* (* c3 26) 26)) (* c2 26))) (setq c3 c3) (setq c2 c2) (setq c1 (+ c1 1)) (setq addr (strcat (vl-princ-to-string (chr (+ 64 c3))) (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r) ":" (vl-princ-to-string (chr (+ 64 c3))) (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r))) );end of cond option 3 );end of cond (setq c (+ c 1)) (vlax-put-property cell 'item r c textstring2) (setvar "cmdecho" 1) (princ) ) (defun ex:ECADR ( / *error* excelapp workbooks sheets acsheet acsheetname accell cell r c captionname addr rng textstring c1 c2 c3 ) (setvar "cmdecho" 0) (defun *error* ( msg ) (if (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*")) (princ (strcat "\n Error: " msg)) ) (vlax-release-object AcSheet) (vlax-release-object Sheets) (vlax-release-object Workbooks) (vlax-release-object ExcelApp) (setvar "cmdecho" 1) (princ) ) ;BIGAL's ah:chkexcel (if (= (setq excelapp (vlax-get-object "Excel.Application") ) nil) ; if open already (setq excelapp (vlax-get-or-create-object "Excel.Application")) ) (if (= (setq acsheet (vlax-get-property ExcelApp 'ActiveSheet)) nil) (vlax-invoke-method (vlax-get-property excelapp 'Workbooks) 'Add) ) (vlax-put Excelapp "visible" :vlax-true) (if (/= (setq captionname (vlax-get-property ExcelApp 'caption)) nil) (progn (princ "\n workbook name - ") (princ captionname) );end of progn ) (setq Workbooks (vlax-get-property ExcelApp 'Workbooks)) (setq Sheets (vlax-get-property ExcelApp 'Sheets)) (setq AcSheet (vlax-get-property ExcelApp 'ActiveSheet)) (setq acsheetname (vlax-get-property acsheet 'name)) (setq accell (vlax-get-property ExcelApp 'Activecell)) (setq cell (vlax-get-property acsheet 'Cells)) (setq r (vlax-get-property accell 'row)) (setq c (vlax-get-property accell 'column)) (princ "\n active sheet now - ") (princ acsheetname) (princ "\n your selected cell is - Row ") (princ r) (princ ", Column ") (princ c) (setq c (- c 1)) (cond ((and (> c -1) (< c 25)) (setq c1 (+ c 1)) (setq addr (strcat (chr (+ 64 c1)) (itoa r) ":" (chr (+ 64 c1)) (itoa r) )) );end of cond option 1 ((and (> c 24) (< c 702)) (setq c2 (fix (/ c 26))) (setq c1 (- c (* c2 26))) (setq c2 c2) (setq c1 (+ c1 1)) (setq addr (strcat (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r) ":" (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r))) );end of cond option 2 ((and (> c 701) (< c 18278)) (setq c3 (fix (/ c (* 26 26)) ) ) (setq c2 (fix (/ (- c (* c3 (* 26 26))) 26))) (setq c1 (- (- c (* (* c3 26) 26)) (* c2 26))) (setq c3 c3) (setq c2 c2) (setq c1 (+ c1 1)) (setq addr (strcat (vl-princ-to-string (chr (+ 64 c3))) (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r) ":" (vl-princ-to-string (chr (+ 64 c3))) (vl-princ-to-string (chr (+ 64 c2))) (vl-princ-to-string (chr (+ 64 c1))) (itoa r))) );end of cond option 3 );end of cond (princ " ( in address format ") (princ addr) (princ " )") (setq c (+ c 1)) (list r c) ) like this ? command : EXATT
    1 point
  5. I have always used the TRIM commandline default <TRIM ALL>, meaning I hit enter right after starting the TRIM command, which makes it act like that. Nice that they appear to have defaulted to that behaviour in later versions.
    1 point
  6. OSOPTIONS, set to ignore Hatch Objects, easiest to do through Options-Drafting-Object Snap Options and select "Ignore hatch objects". As mentioned, mostly sounds like a computer issue. What OS are you using? Can you post a drawing with this problem, just to check?
    1 point
  7. I have shared a Dynamic Block and you can download through the link below and also can watch video that demonstrate it how to use 2D dynamic block to develop a flat pattern of a cone that has been oblique Section. I hope you will subscribe and Like my video/channel. Thanks Download Dynamic Block of Cone Development
    1 point
  8. Grace, God, you attached so much files to your post... Do you know you could use zip and pack them all in single file? Even if someone tries to help you I believe this is too much from you asking someone to download that much files...
    1 point
×
×
  • Create New...