Jump to content

Recommended Posts

Posted

is there any option to export is block to excel file and 2nd i have one excel file which is batter then this i mean updated one i want to bring that one in cad so how can i do that?

test.dwg

  • Replies 34
  • Created
  • Last Reply

Top Posters In This Topic

  • ReMark

    15

  • kamig

    14

  • Sweety

    4

  • fixo

    2

Top Posters In This Topic

Posted Images

Posted

I am sorry , I don't think I follow you .

 

Can you explain more ?

 

Good day .:)

Posted

sweety did you open the drawing just look that 1st??

Posted

It looks like kamig wants to bring his table from AutoCAD into Excel.

 

Excel files can be linked with AutoCAD drawings via the Table command and the DataLink option.

Posted

Select the table and right click then export to excel :shock:

Posted

You can export to a .CSV file not to a .XLS file.

Posted
You can export to a .CSV file not to a .XLS file.

 

What is the difference ? aren't they the same , I mean excel file .

Posted

if i export to a .CSV file then i have to rearange all the colum & cell

Posted

XLS is the native file type for an Excel spreadsheet.

 

CSV is a comma delimited file. I believe one has to import a CSV file.

Posted
if i export to a .CSV file then i have to rearange all the colum & cell

 

No, you don't.

Posted

Kamig

 

I see you have Water flow for the VAV , do you feed a VAV with water in the country you live or work in ? :o

 

Does it work on Water or it needs water to run ?

Posted
Kamig

 

I see you have Water flow for the VAV , do you feed a VAV with water in the country you live or work in ? :o

 

Does it work on Water or it needs water to run ?

 

I fail to see how this has anything to do with the question we're trying to answer.

Posted

Now i try .csv file but there is some formula i put that one not appear in .csv file so how can i update that one??

Posted

yes sweety i am working in Saudi Arabia here we have VAV with Water Heater which is working fine?

Posted

see here i attached the excel file where only i have to in put the l/s then other will come auto if i want this same think in CAD is it possibal???

Book1.xls

Posted

You'll probably have to put the formula in manually.

Posted

i try but not working in cad which is on attached excel file

Posted

Attached how? Is it an OLE object or did you create a Datalink?

Posted

Try this code to read Xl


(defun C:XLRD (/ *error* GetXlRangeByMatch address filename sheetname x xlapp 
xlbook xldata xlrange)
(vl-load-com)
  (defun *error* 
(msg)
   
   (if xlbook 
(vl-catch-all-apply 'vlax-invoke-method (list xlbook 'Close 
:vlax-false)))
   (gc)
   (if xlapp 
(vl-catch-all-apply 'vlax-invoke-method (list xlapp 
'Quit)))
   (gc)
   (cond ((not 
msg))                                                   
; Normal exit
         ((member 
msg '("Function cancelled" "quit / exit abort")))    ; 
<esc> or (quit)
         
((princ (strcat "\n---  Error: " msg "  ---")))
   
)                                                                   
; Fatal error, display it
 (princ)
   ) 
(defun 
GetXlRangeByAddress(filename sheetname address / all_skvs xlbook xlrange xlsheet 
xlapp skv_records)
 
 
   (setq 
xlapp(vlax-get-or-create-object "Excel.Application"))
   
(vla-put-visible xlapp :vlax-false)
   (vlax-put-property 
xlapp 'DisplayAlerts :vlax-false)
 (if (zerop 
(vlax-get-property(vlax-get-property xlapp 'workbooks) 
'count))
    (setq xlbook 
(vl-catch-all-apply
    
'vla-open
    (list (vlax-get-property xlapp 'WorkBooks) 
fileName)
    )
     
)
 (setq xlbook (vl-catch-all-apply 'vlax-get-property (list xlapp 
'activeworkbook))))



(setq xlsheet (vl-catch-all-apply
    
'vlax-get-property
    (list (vlax-get-property xlbook 
'Sheets)
   'Item
   1 ;|"Sheet1" 
maybe|;;< --- sheet name or number
   
)
    )
     )
 

   (vlax-invoke-method xlsheet 
'Activate)
   (setq xlrange (vlax-get-property 
(vlax-get-property xlsheet 'Cells) 'Range address))
   (if 
(eq :vlax-true (vlax-variant-value(vlax-get-property xlrange 
'HasFormula)))
    (setq xldata (vlax-get-property 
xlrange 'formulalocal))
    (setq 
xldata(vlax-get-property xlrange 'value2)))


 (setq xldata (mapcar '(lambda(x)(mapcar 'vlax-variant-value 
x))
        
(vlax-safearray->list
   
(vlax-variant-value
     xldata))))



  (vl-catch-all-apply 'vlax-invoke-method (list xlbook 'close 
:vlax-false))
 (vlax-put-property xlapp 'DisplayAlerts 
:vlax-true)
 (gc);; before QUIT
   
(vl-catch-all-apply 'vlax-invoke-method (list xlapp 'quit))
 (mapcar 
'(lambda(x)(if (and x (not (vlax-object-released-p 
x)))
        
(progn(vlax-release-object x)(setq x nil))))
  (list xlrange 
xlsheet xlbook xlapp))
 
 (gc);; after QUIT


     xldata
 )


 ;;___________________________  main part  
_____________________________________________;;


 ;; e.g.: 
 (setq filename (findfile 
"C:\\blah\\blah\\blah.xls")
sheetname 1
address 
"A3:E18")
 (setq xlData (GetXlRangeByAddress filename sheetname 
address))
 (print xlData)
 
 ;;;   
---   rest your mojo here   ---   ;;;
 

 (*error* nil)
 (princ)
 )
(princ 
"\n\t\t---\tStart command with XLRD\t---")
(prin1)
(or 
(vl-load-com)(princ))

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