- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Dimensions from Cad to a pre-existing Excel file?
If I can get as close as possible that would be awesome!
Is there a lisp and/or way to transfer dimension text to a specific cell in a pre-existing Excel template instead of it creating a new book each time?
Thanks!
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Just to be clear, you want to be able to select a single dimension line in AutoCAD and have the dimension value copied to a specific cell of an Excel spreadsheet?
BTW, what is the difference between an existing Excel file and a "pre-existing" file. Did the latter exist before it existed? What does that mean?
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
gist of it.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Would the following be acceptable?
1. The user selects a dimension line in AutoCAD, gives a command and a text file is automatically created.
2. A VBA macro is run in an open Excel file and the text file is referenced and the dim value is placed in the selected cell.
This processed could be enhanced such that the user is prompted for a cell address when giving the command in AutoCAD and then referenced when the macro is run in Excel.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
dimensions at one correct?
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Please be more specific about how to handle multiple dimensions. For example:
Pla A
1. User selects several dimensions, gives command.
2. In Excel all the dimension values are place in one cell.
or
Plan B
1. User selects several dimensions, gives command.
2. In Excel the first dimension value is placed in the selected cell and other values successively in cells below it.
or
Plan C
1. User gives command and then is prompted to select a dimension line then asked for a cell number, the process is repeated until the user indicates he/she is done.
2. In Excel the dimensions are placed in their respective cells.
or something else?
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
The following vlisp program creates a CSV file of the values of selected dimension lines. It can be directly opened by Excel and then copy and pasted to wherever you wish.
(defun c:getdims (/ fn)
; create a csv file of selected dimension lines.
; LRM 1/16/2019
;
(setq f (getfiled "Create Output File" "" "csv" 1))
(setq fn (open f "w"))
(if (setq ss (ssget '((0 . "DIMENSION"))))
(progn
(setq i 0)
(while (setq en (ssname ss i))
(setq ed (entget en))
(setq dv (cdr (assoc 42 ed)))
(if (= (cdr (assoc 70 ed)) 34) ; check if angular dim
(setq dv (/ (* dv 180) 3.xxx-xxxxxxxx))
)
(write-line (rtos dv) fn)
(setq i (1+ i)
) ; end setq i
) ;end while
) ; end progn
) ;end if
(close fn)
(princ "\n File ") (princ f) (princ " created.")
(princ)
)
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
You are welcome.
Somehow the line in the code above :
(setq dv (/ (* dv 180) 3.xxx-xxxxxxxx))
was not what I copied into my post. That line should read:
(setq dv (/ (* dv 180) 3.xxx-xxxxxxxx))
It converts the angle value from radians to degrees. The code in the attached program GetDims.lsp is correct.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
@leeminardi, if you post a number that's a certain amount of digits long, the forums will automatically replace it with xxxxx as it is the length of the Autodesk activation key (or maybe license number, I can't remember). it's to stop people posting registration information but it works on any number with that many digits.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
Thanks @Anonymous, I did not know that the forum software did that. It would have driven me nuts to figure out what was going on. Thanks for saving my sanity!