Antonio Landsberger Posted August 4, 2021 Share Posted August 4, 2021 When tagging an object using a data tag, a connection between the two is established. I'd like to find a way to get the handle of the objects that was tagged by a certain data tag. In my mind a command could look like this hTaggedObj = vs.DT_GetAssociatedObj( hDT ) The only commands about data tags I could find in the developer wiki are these two: https://developer.vectorworks.net/index.php/VS:DT_AssociateWithObj https://developer.vectorworks.net/index.php/VS:DT_UpdateTagsOfTagged The List View Ex dialog of the debug mode wasn't much help either. Quote Link to comment
JBenghiat Posted August 4, 2021 Share Posted August 4, 2021 This is not possible with vs, only the SDK Quote Link to comment
DomC Posted September 23, 2021 Share Posted September 23, 2021 What about this: def IsTagged(h): result = False; num = vs.GetNumAssociations(h) assH = None assKind = None value = None i = 0; while(i < num and result == False): assH, assKind, value = vs.GetAssociation(h, i); if (assKind == 37): result = True; i = i + 1; return result, assH; This would help finding Tagged Object. This was some I found in the Forum here. It works in a Marionette Object, which is inside a DataTag to find the tagged Object. So I think you could loop all Objects and check with vs.GetAssociation() type 37. Then you have the Tag and could check the Kind of Tag. 1 Quote Link to comment
heikolistische Posted February 23, 2022 Share Posted February 23, 2022 This one, used while in Annotations, uses the selexted Datatag and jumps to the tagged Object in yours Model and select it. import vs; objs = [] def Name(h): hLayerObj = vs.GetLayer(h) hLayerAct = vs.ActLayer() vs.AlrtDialog(vs.GetName(h)) hAss, iAssKind, iAssVal = vs.GetAssociation(h, 0) if hAss != 0: objs.append(hAss) vs.ForEachObject(Name, "((INSYMBOL & INOBJECT & INVIEWPORT & (VSEL=TRUE)))") if len(objs) == 1: hLayObjs1 = vs.GetLayer(objs[0]) vs.DoMenuTextByName('Group Navigation Chunk', 2) #Verlasse Ergänzungen vs.Layer(vs.GetLName(hLayObjs1)) #Wechsel Ebene vs.SetPref(94, True) #Aktuivere Modellansicht vs.SetPref(14, True) #Zeige Objekte auerhalb Gruppe vs.DSelectAll() for x in objs: hParObj = vs.GetParent(x) iTypParObj = vs.GetTypeN(hParObj) if iTypParObj == 11: vs.SetSelect(hParObj) vs.DoMenuTextByName('Group Navigation Chunk', 1) if iTypParObj == 15: vs.SetSelect(hParObj) vs.DoMenuTextByName('Group Navigation Chunk', 1) vs.SetSelect(x) vs.DoMenuTextByName ('Fit To Objects', 0) Hope this one is helpful. Have fun, Heiko Jakob Quote Link to comment
Recommended Posts
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.