Jump to content

"activex server returned an error" - invalid index.


muthu123

Recommended Posts

Dear friends,

The Following code is returns error in one of our systems in our concern and in all others are working fine.

 

(vlax-safearray->list (vlax-variant-value (vla-getAttributes Blk_name)))

 

yours,

Muthu.

Link to comment
Share on other sites

Perhaps the block does not have attributes, a few ways to check (in all examples 'bObj' is a VLA Block Reference Object.

 

( 1 )

(vlax-invoke bObj 'GetAttributes)

 

Will return nil if the block does not have attribs.

 

( 2 )

 

Check that the block has attributes first:

 

(eq :vlax-true (vla-get-HasAttributes bObj))

( 3 )

 

Check the upper bound of the first dimension of the safearray, a negative upper bound indicates an empty safearray.

 

(< 0
 (vlax-safearray-get-u-bound
   (vlax-variant-value (vla-getAttributes bObj)) 1
 )
)

 

Lee

Link to comment
Share on other sites

Perhaps the block does not have attributes, a few ways to check (in all examples 'bObj' is a VLA Block Reference Object.

 

( 1 )

(vlax-invoke bObj 'GetAttributes)

 

Will return nil if the block does not have attribs.

 

( 2 )

 

Check that the block has attributes first:

 

(eq :vlax-true (vla-get-HasAttributes bObj))

 

( 3 )

 

Check the upper bound of the first dimension of the safearray, a negative upper bound indicates an empty safearray.

 

(< 0
 (vlax-safearray-get-u-bound
   (vlax-variant-value (vla-getAttributes bObj)) 1
 )
)

 

Lee

 

 

Dear lee,

 

But the thing is the same drawing is working in all other systems.

I don't know how to solve this?. Is there any change in Acad settings?

 

Sincerly,

Muthu.

Link to comment
Share on other sites

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