A tag of tag

A tag of tag

Anonymous
Not applicable
804 Views
1 Reply
Message 1 of 2

A tag of tag

Anonymous
Not applicable

I community,

I just finish a formation in autocad electrical and i just hit a limitation.

i hope you could help.

I make a symbol library of a plc and i need to make a concatenation of several tag.

i use the autocad field command to retrive information from %<\AcObjProp Object(%<\_ObjId XXXXX>%).TextString>%.

What i understand so far, _Objld is an absolute reference of a Attribute Definition (tag).

So each time i use the icon all the field stay blanc because the field model have no value.

So two thing, first i need to update the _ObjId each time (lisp, diesel) i use the icon or there is a other methode that i cant thing or find form the internet.

here a visual of the problem.

 

moment.electrical_contatenation.pngelectrical_contatenation_fail.png

 

Thx for your help.

0 Likes
805 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

I think i found something, it limited on the usability, but it have a great potential.

(defun c:selent ()
  ;selection d'une entité
  (setq a (entsel))
  ;On isole l'entité de son pick point
  (setq Ent (car a))
  ;On active le module activeX
  (vl-load-com)
  ;Conversion de l'entiter en (V)isual(L)isp(A)ctivX-Object
  ;tratuction de l'entié en liste d'attribut ActivX
  (setq vlaEnt (vlax-ename->vla-object ent)
        retV   (vla-GetAttributes vlaEnt)
        V      (vlax-variant-value retV)
        ret    (vlax-safearray->list V)
	tot    (length ret)
	i 0)
  (print (type retV))
  (print (type V))
  (print (type ret))
  (print (type tot))
  ;(vlax-dump-object (car ret) T)
  (while (< i tot)
    (if (= (vlax-get-property (nth i ret) "TagString") "INST")
      (setq INST (vlax-get-property (nth i ret) "TextString"))
    )
    (if (= (vlax-get-property (nth i ret) "TagString") "LOC")
      (setq LOC (vlax-get-property (nth i ret) "TextString"))
    )
    (if (= (vlax-get-property (nth i ret) "TagString") "LINE1")
      (setq RACK (vlax-get-property (nth i ret) "TextString"))
    )
    (if (= (vlax-get-property (nth i ret) "TagString") "LINE2")
      (setq SLOT (vlax-get-property (nth i ret) "TextString"))
    )
    (setq i (+ 1 i))
  )
  (print (strcat INST "-" LOC "-I/O " RACK "." SLOT))
  (princ)
)

on the todo liste i want to remove the pick entity and use a automatic on place of the object ( on event or some thing like that)

Any help or advice is welcome and i continu my research.

 

0 Likes