Jump to content

Recommended Posts

Posted

Hi All

 

I am trying to use the vla-get-promptstring for an attribute definition

 

;vlax-safearray->list (getattribute) method

 

However the response i recieve is

 

error: ActiveX Server returned the error: unknown name:

 

Any thoughts

 

Cheers

Ollie

Posted

You will have to approach it this way Ollie to get the Prompt String:

 

(defun getpmt (blk)
 (if (tblsearch "BLOCK" blk)
   (vlax-for Obj (vla-item
                   (vla-get-Blocks
                     (vla-get-Activedocument
                       (vlax-get-acad-object))) blk)
     (if (eq "AcDbAttributeDefinition"
             (vla-get-ObjectName Obj))
       (setq pmt (vla-get-PromptString Obj)))))
 pmt)

Posted

Once again Lee thanks.

 

Can't believe how complicated that is in comparison to the grab properties for the other members

 

Ollie

Posted

No problem Ollie.

 

Bear in mind that the above will cycle through every attribute definition (if there is more than one) - and so you may need to filter it for attribute tagstring also. :thumbsup:

 

Lee

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