VLA-GET-HASATTRIBUTES does not work in P3D

VLA-GET-HASATTRIBUTES does not work in P3D

Anonymous
Not applicable
1,238 Views
7 Replies
Message 1 of 8

VLA-GET-HASATTRIBUTES does not work in P3D

Anonymous
Not applicable

Hello,

 

when I use a routine with VLA-GET-HASATTRIBUTES in ACAD it works.

 

When I use it in P3D it does not.

 

***

"; Fehler: ActiveX-Server gab folgenden Fehler zurück: unbekannter Name: HasAttributes"

***

 

( (VLAX-ENAME->VLA-OBJECT EntityName) works...)

 

 

Guido

0 Likes
Accepted solutions (1)
1,239 Views
7 Replies
Replies (7)
Message 2 of 8

JustOpie
Advocate
Advocate
Have you executed (vl-load-com) function?
0 Likes
Message 3 of 8

Anonymous
Not applicable

Hi

 

yes.

 

 

....( (VLAX-ENAME->VLA-OBJECT EntityName) works...)

0 Likes
Message 4 of 8

_Tharwat
Advisor
Advisor

Show the related codes to that function to check them out for you.

0 Likes
Message 5 of 8

Anonymous
Not applicable

Hello,

 

here is that small routine

(and it works in normal ACAD)

 

(defun c:ba()

  	(setq ss (ssget))
  	(setq EntityName (ssname ss 0))
	       
	(SETQ VLA_OBJECT (VLAX-ENAME->VLA-OBJECT EntityName))
  
  	(IF (AND
	      	(= (VLA-GET-HASATTRIBUTES VLA_OBJECT) :VLAX-TRUE)
      		(SAFEARRAY-VALUE (SETQ Attribute (VLAX-VARIANT-VALUE (VLA-GETATTRIBUTES VLA_OBJECT)))))

	  	(progn

		  	(FOREACH Tag (VLAX-SAFEARRAY->LIST Attribute);Attribs auslesen
			  
			  	(print (strcat (VLA-GET-TAGSTRING Tag) ": " (VLA-GET-TEXTSTRING Tag)));TAG groß/klein beachten!!!!
		    	)
		)	 
  	)
)
0 Likes
Message 6 of 8

_Tharwat
Advisor
Advisor
Accepted solution

Have a play with this:

 

(defun c:ba  (/ ss)
  (if (setq ss (ssget '((0 . "INSERT") (66 . 1))))
    (foreach tag  (vlax-invoke (vlax-ename->vla-object (ssname ss 0)) 'getattributes)
      (print (strcat (vla-get-tagstring tag) ": " (vla-get-textstring tag)))
      )
    )
  (princ)
  ) (vl-load-com)
Message 7 of 8

Anonymous
Not applicable

OK, that's it

 

the

'((0 . "INSERT") (66 . 1))

makes the difference.

 

But the error messages has confused me.

 

Thanks

0 Likes
Message 8 of 8

_Tharwat
Advisor
Advisor

You are welcome - Happy to help.

0 Likes