Copy of aspect via Afw.Interop.ABBObjectAutomationInterfaces results in aspect with same GuidID as the source
When I, in a VS2012 Visual Basic application, copy a source aspect
SourceAspect As Afw.Interop.ABBObjectAutomationInterfaces.ABBAspect
to a target object and target aspect
TargetCursor As Afw.Interop.ABBObjectAutomationInterfaces.ABBStructureCursor
TargetAspect As Afw.Interop.ABBObjectAutomationInterfaces.ABBAspect
using
TargetAspect = ABBAspect.Copy(TargetCursor.Object)
TargetAspect.Name = [New name]
the copy works fine, but the target aspect has the same GuidID as the source aspect.
This is of course a big problem.
What should I do to get around this problem - getting a unique Guid ?
SourceAspect As Afw.Interop.ABBObjectAutomationInterfaces.ABBAspect
to a target object and target aspect
TargetCursor As Afw.Interop.ABBObjectAutomationInterfaces.ABBStructureCursor
TargetAspect As Afw.Interop.ABBObjectAutomationInterfaces.ABBAspect
using
TargetAspect = ABBAspect.Copy(TargetCursor.Object)
TargetAspect.Name = [New name]
the copy works fine, but the target aspect has the same GuidID as the source aspect.
This is of course a big problem.
What should I do to get around this problem - getting a unique Guid ?
Answers
This question has not yet been answered.
by niels.e.larsen Rank: 2382 on 4/10/2020 7:18:12 AM | Like (0) | Report
It should of course have been:
... using
TargetAspect = SourceAspect.Copy(TargetCursor.Object)
TargetAspect.Name = [New name]
by Martin87 Rank: 105 on 4/12/2020 5:51:11 AM | Like (0) | Report
I'm not sure I understand the question.
You can use VS Create Guid tool under Tools in VS?
by niels.e.larsen Rank: 2382 on 4/27/2020 12:27:18 AM | Like (0) | Report
I simply do not understand why the interface doesn't provide a new ID to the copied aspect.
It doesn't make any sense to me, that there can be several unique aspects with the same ID (Guid).
If you make the copy by hand (right-click Copy and right-click Paste) in a plant explorer, 800xA automatically provides a new unique ID to the new aspect.
Furthermore I cannot find a method to change the ID via the interface as TargetAspect.ID is read-only.
Add new comment