You might try this. {Untested}
(defun c:blkins (/ AllData data *error*)
;|
ATTDIA
Controls whether the -INSERT command uses a dialog box for attribute value entry. See "INSERT Command Line."
0 Issues prompts on the command line
1 Uses a dialog box
ATTMODE
Controls display of attributes.
0 Off: Makes all attributes invisible
1 Normal: Retains current visibility of each attribute: visible attributes are
displayed; invisible attributes are not
2 On: Makes all attributes visible
ATTREQ
Determines whether the INSERT command uses default attribute settings during insertion of blocks.
0 Assumes the defaults for the values of all attributes
1 Turns on prompts or dialog box for attribute values, as specified by ATTDIA
TEXTEVAL
Controls the method of evaluation of text strings.
0 All responses to prompts for text strings and attribute values are taken literally
1 Text starting with an opening parenthesis [ ( ] or an exclamation mark (!) is
evaluated as an AutoLISP expression, as for nontextual input
|;
;; error function & Routine Exit
(defun *error* (msg)
(if
(not
(member
msg
'("console break" "Function cancelled" "quit / exit abort" "")
)
)
(princ (strcat "\nError: " msg))
) ; endif
(and sysattdia (setvar "ATTDIA" sysattdia)) ; reset vars
(and sysattreq (setvar "ATTREQ" sysattreq))
(and systxteva (setvar "TEXTEVAL" systxteva))
(setq sysattdia nil)
(setq sysattreq nil)
(setq systxteva nil)
)
;; Start Here -----------------
(setq sysattdia (getvar "ATTDIA"))
(setq sysattreq (getvar "ATTREQ"))
(setq systxteva (getvar "TEXTEVAL"))
(setvar "ATTDIA" 0)
(setvar "ATTREQ" 1)
(setvar "TEXTEVAL" 0)
;|
'(("R1" "X coordinate" "Y coordinate" "Z coordinate" "Rotation"
"X Scale" "Y Scale" "Z Scale" "Layer" "Attribute 1" "Attribute 2")
("R2" "6" "12" "0" "0" "1" "1" "1" "2" "AB" "100")
("R3" "12" "6" "0" "90" "2" "2" "2" "3" "GE" "200"))
|;
(setq BlkName "MyBlockName")
(setq Alldata
(GetExcel "C:\\Documents and Settings\\dguenthner\\My Documents\\Attribute Info.xlsx" nil nil))
(print data)
(foreach data AllData
(command "-INSERT" BlkName
"X" (nth 5 data) "Y" (nth 6 data) "Z" (nth 7 data)
"_none" (list (nth 1 data)(nth 2 data)(nth 3 data))
(nth 4 data) ; Rotation angle (optional; default = 0)
(nth 9 data)
(nth 10 data)
)
(command "_.chprop" (entlast) "" "LA" (nth 8 data) "")
)
(CloseExcel nil)
(princ)
)