Set Tag Values in Selected Element Only

Hi All,

Having a problem with setting a tag value through VBA.

I want to only set a single TagSet, but it has the same name as another set placed on the design already.

The Cell is called "DM1" and contains a TagSet called "Deco". This cell needs to be placed many times on the same design. I thought about using tags to try to store additional information in each cell that i can then extract with VBA.

Problem i have is that i can set the tag value once when placing the cell. When i place the next cell the values don't change (as I'm assuming its "resetting" the first cell's tags)

I can also get VBA to change all of the TagSet values in the entire design at once, but this is not wanted as the information i'm wanting to store is for that particular cell, not all of them.

Is there a way - through VBA - that you can update TagSet values in a selected element?

I have looked around the forums and have tried a few things but nothing is giving me the exact answer im looking for.

I'm hoping that i can do something along of the lines of when placing the cell, i can use GetLastValidElement and run a SetTag command on it, which won't affect the rest of the Tags.

I have come up with a bit of code, but removed all the SetTags part as i think its wrong... hoping someone can point me in the right direction.

Dim oMSG As CadInputMessage
Dim oLastElement As Element

PlaceAgain:
Set oMSG = CadInputQueue.GetInput()
Do While oMSG.InputType <> msdCadInputTypeReset
If oMSG.InputType = msdCadInputTypeDataPoint Then
CadInputQueue.SendDataPoint oMSG.Point

Set oLastElement = ActiveModelReference.GraphicalElementCache.GetLastValidElement

'Set Tag Values for oLastElement (1st Tag with Value of sString1, 2nd Tag with Value of sStrign 2 etc)

GoTo PlaceAgain

ElseIf oMSG.InputType = msdCadInputTypeReset Then
CadInputQueue.SendReset
CommandState.StartDefaultCommand
End If
Loop

Cheers!

Rob