Author Topic: vla-explode error - Automation Error. Invalid input  (Read 1974 times)

0 Members and 1 Guest are viewing this topic.

csgoh

  • Newt
  • Posts: 176
vla-explode error - Automation Error. Invalid input
« on: July 25, 2006, 09:25:15 AM »
Code: [Select]
;;
;; 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?
« Last Edit: July 25, 2006, 09:30:36 AM by csgoh »

hmspe

  • Bull Frog
  • Posts: 362
Re: vla-explode error - Automation Error. Invalid input
« Reply #1 on: July 25, 2006, 09:55:31 AM »
This may or may not be applicable, but there's a note to the VxGetBlockInters function at http://www.menziengineering.ch/ that reads:

" Because of a (reported) bug in A2k4/A2k5/A2k6, the used explode method will fail on NUS blocks. No limitations in A2k, A2ki and A2k2"

NUS = non-uniformly scaled.  Therea are also a couple of other posts at theswamp saying the explode method doesn't work with NUS blocks for R2004 and newer.  I didn't find a work-around posted.

Martin
"Science is the belief in the ignorance of experts." - Richard Feynman