.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Attribute to move to block without the old ATT

35 REPLIES 35
Reply
Message 1 of 36
cadheinz
1060 Views, 35 Replies

Attribute to move to block without the old ATT

Hello I can help defense.
How can I add an attribute to a block without the other attributes to move from their position.
With the ATTSYNC belongs unfortunately not because the old attributes moved back to the original places that I will not.
Please help

 (Attribut zu Block ohne die alten ATT zu verschieben)

Hallo kann mir wehr Helfen.
Wie kann ich ein Attribut zu einem Block hinzufügen ohne die anderen Attribute von ihrer Position zu verschieben.
Mit ATTSync gehrt das leider nicht da werden die alten Attribute wieder auf die Originalplätze verschoben das will ich aber nicht.
Bitte um Hilfe

DH
35 REPLIES 35
Message 21 of 36
Hallex
in reply to: cadheinz

Glad I could help

Bitte shoen

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 22 of 36
Hallex
in reply to: cadheinz

Please, upload the  sample drawing in A2007 format

with your old block and manually inserted

the new block with attributes, I will play with it later

coz I'm a bit busy with my own now

 

~'J'~

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 23 of 36
cadheinz
in reply to: Hallex

I find that the Toll me helping you.
Thanks again

 

Das finde ich Toll das sie mir so helfen.

Danke nochmals

DH
Message 24 of 36
cadheinz
in reply to: Hallex

Please, upload the  sample drawing in A2007 format

with your old block and manually inserted

the new block with attributes, I will play with it later

coz I'm a bit busy with my own now

 

I now understand what it is not quite as mean

das versteh ich jetzt nicht ganz was sie da meinen

DH
Message 25 of 36
cadheinz
in reply to: Hallex

Here I have a lisp what I mean.
Unfortunately, it is not who I rictig several Att.
Or in foreign blocks it also does not want to work properly

 

Hier habe ich ein Lisp wie ich das meine.

Leider läuft es nicht rictig wen ich mehrere Att habe.

Oder bei Fremdblöcken will es auch nicht richtig funktionieren

 

(defun c:attsync2 (/ _name _gettatts _lst atts e name ss)
  (vl-load-com)
  (defun _lst (ss / e n out)
    (setq n -1)
    (if	(= (type ss) 'pickset)
      (while (setq e (ssname ss (setq n (1+ n)))) (setq out (cons (vlax-ename->vla-object e) out)))
    )
  )
  (defun _attpositions (block / att result)
    (foreach att (vlax-invoke block 'getattributes)
      (setq result (cons (list (vla-get-handle att)
			       (vlax-get att 'insertionpoint)
			       (vlax-get att 'textalignmentpoint)
			 )
			 result
		   )
      )
    )
  )
  (defun _name (b)
    (cond ((vlax-property-available-p b 'effectivename) (vla-get-effectivename b))
	  ((vlax-property-available-p b 'name) (vla-get-name b))
    )
  )
  (if (and (setq e (car (entsel "\nSelect block to sync: ")))
	   (setq name (_name (vlax-ename->vla-object e)))
	   (setq ss (ssget "_x" (list (cons 0 "insert"))))
      )
    (progn (foreach x (_lst ss) (and (eq (_name x) name) (setq atts (cons (_attpositions x) atts))))
	   (command "._attsync" "_s" e "_yes")
	   (foreach x (apply 'append atts)
	     (if (and (setq e (handent (car x))) (setq e (vlax-ename->vla-object e)))
	       (progn (vl-catch-all-apply 'vlax-put (list e 'insertionpoint (cadr x)))
		      (vl-catch-all-apply 'vlax-put (list e 'textalignmentpoint (caddr x)))
	       )
	     )
	   )
    )
  )
  (princ)
)

 thank you

DH
Message 26 of 36
Alfred.NESWADBA
in reply to: cadheinz

Hi,

 

brauchst Du's jetzt mit LISP oder mit dotNET? Wenn dotNET, dann welche Version hast Du ... VS2010 oder VS2012?

 

Sind die Vorgaben, dass Du bereits die Blockdefintion fertig hast und nur das eigene ATTSYNC nachlaufen soll oder muss ein neues Attribut auch erst der Blockdefinition hinzugefügt werden?

 

Ev. hast Du eine Musterzeichnung, die des Status darstellt vor Deinem eigenen ATTSYNC?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 27 of 36
cadheinz
in reply to: Hallex

Hallo

 

Wir haben Autocad 2013, net oder Lisp ist mir gleich.( Wobei ich weiss das ihn 3 Jahren das net wieder nicht laufen wird da änderungen vorgenommen werden bei Autodesk.)

Ich mache das zur Zeit so füge ein ATT hinzu und verwende dann das ATTsync2.

Mir ist gleich wie das Programm abläuft ich will nur ein ATT einfügen und die alten ATT sollen ihre Postition behalten.

Schade das das Autocad nicht kann.

Ist doch normal wen ich ein grosse Zeichung habe das da meine ATT einmal verschoben werden müssen.

Und das ATTSYCN von Autocad ist da nicht zu gebrauchen wenn ich ein ATT anhängen muss der verschiebt mir doch alles wieder.

Danke

 

 

DH
Message 28 of 36
Alfred.NESWADBA
in reply to: cadheinz

Hi,

 

>> Mir ist gleich wie das Programm abläuft

So it seems to be not interesting of how the code looks like, you just need the functionality?

Ok, find attached two DLL's,

  • one in the directory "bin_18_00" ==> for AutoCAD 2010/2011/2012
  • one in the directory "bin_19_00" ==> for AutoCAD 2013

You can NETLOAD the corresponding DLL into your AutoCAD and start then the command AN_ATTSYNC

 

When it's started you get a dialog with a list of available blocknames in the current drawing, you can choose the blockname either in the list or with the button right to the list and selecting one blockreference.

After you selected the blockreference you'll get the attributes listed that are definied within the blockdefinition(!), activate the attributes you want to get synchronised and click "SYNC".

 

AN_AttSync_Basics01.gif

 

IMPORTANT: this is just written as is and not really tested, so first save...then execute.

If there is any feedback ==> thank you in advance! 😉

(If anyone needs the source (VS2012, vb.net) leave a message here)

 

It currently does not support specials like dynamic block, unnamed blocks, annotative blockreferences.

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 29 of 36
cadheinz
in reply to: Hallex

Super Thank you Thank you

'll Try tomorrow once, and then you give modest as it runs.

 

 

Super Danke Danke

 

Werde das morgen mal Testen, und Ihnen dann bescheid geben wie es läuft.

 

DH
Message 30 of 36
cadheinz
in reply to: Hallex

Thanks for the program Work perfect for us.
I have a block because it will not work so well.

Thanks again

 

Danke das Programm Arbeite perfekt für uns.
Einen Block habe ich da will das nicht so recht funktionieren.

Danke nochmal

 

 

DH
Message 31 of 36
Alfred.NESWADBA
in reply to: cadheinz

Hi,

 

can you tell me, what is not working?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 32 of 36
cadheinz
in reply to: Alfred.NESWADBA

I have a block attached dr makes problems.
But is not that important, the other work perfectly
Thank you

 

Ich habe einen Block angehängt dr macht Probleme.
Ist aber nicht so wichtig, die anderen funktionieren perfekt
Danke

 

 

 

DH
Message 33 of 36
Alfred.NESWADBA
in reply to: cadheinz

Hi,

 

die Frage wäre "welche Probleme"? Wenn ich die DWG öffne und mein AN_AttSync starte, dann läuft es mal durch ohne Probleme. Was passiert denn bzw. was passiert nicht?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 34 of 36
cadheinz
in reply to: Alfred.NESWADBA

Ich bekomme diese Meldung siehe Bild

DH
Message 35 of 36
Alfred.NESWADBA
in reply to: cadheinz

Hi,

 

ok, es ist ein dynamischer Block (hat einen Basispunktparameter) und damit fällt der leider in Kategorie (noch nicht unterstützt). Wenn es der einzige ist und daher nicht unglaublich problematisch, dann ok, wenn es mal wichtig wird, lass es mich wissen.


- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 36 of 36
cadheinz
in reply to: Alfred.NESWADBA

Ok 

Nein ist nicht wichtig, werde auf das Angebot zurückkommen, wenn es so weit ist.

 

Vielen Danke 

DH

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost