;;
;; Function InsertABlock
;; Arguments
;; aBlock - [String] block name to insert
;; aRotationAngle - [real] angle of rotation of the UCS
;; from - [integer] for trans function from
;; to - [integer] for trans function to
;; xsc - [+ve real] scale factor
;; space? - [vla-object] mspace or paper space object
;;
(defun InsertABlock ( aBlock aRotationAngle from to xsc ysc space?
/ objBlocks blockslist fn aNewBlock aBlock from aRotationangle to xsc space?)
(setq objBlocks (vla-get-Blocks GB:ActivedocumentObj)
blockslist (WG:GetName-any-type objBlocks)
)
(if (not (member (strcase aBlock) blockslist))
(progn
(setq fn (findfile (strcat "C:/GOH/DWG/" (strcase aBlock) ".dwg")))
(if fn
(progn
(setq aNewBlock (vla-InsertBlock Space?
(vlax-3d-point (trans (car AllCoords-list) from to))
fn xsc ysc xsc 0.0))
)
(progn
(dos_beep 3)
(alert (strcat "Block \"" aBlock "\" dwg not in folder C:/GOH/DWG"))
(exit)
)
);if
);progn
(progn
(setq aNewBlock (vla-InsertBlock Space?
(vlax-3d-point (trans (car AllCoords-list) from to))
(strcase aBlock)
xsc ysc xsc 0.0)
)
);progn
);if
(vla-put-Rotation aNewBlock aRotationangle)
; (setq alist (wg:VariantArrayToList (vla-Explode aNewBlock)))
(print "here")
(vla-Explode aNewBlock)
(vla-Delete aNewBlock)
);InsertABlock
I use aacadmap 2004 and when the xsc and ysc variable is not equal it returns an automation error at vla-explode aNewblock. Can anyone explain why this is so? Why cant the x and y scale factor be a different value?