RsDataDeclarationCollection Class |
Namespace: ABB.Robotics.RobotStudio.Stations
public class RsDataDeclarationCollection : ICollection, IEnumerable, IEnumerable<RsDataDeclaration>
The RsDataDeclarationCollection type exposes the following members.
Name | Description | |
---|---|---|
Count | ||
IsSynchronized | ||
ItemInt32 | ||
ItemString | Obsolete. Gets the declaration with the specified name. | |
Parent | ||
SyncRoot |
Name | Description | |
---|---|---|
Add |
Adds a RsDataDeclaration to the collection.
| |
Contains(String) | Obsolete.
Checks if the the collecction contains a RsDataDeclaration.
| |
Contains(RsDataDeclaration) | ||
CopyTo(Array, Int32) | ||
CopyTo(RsDataDeclaration, Int32) | ||
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetEnumerator | ||
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
Remove |
Removes a RsDataDeclaration from the collection.
| |
ToArray | ||
ToString | (Inherited from Object.) | |
TryGetDataDeclaration | Obsolete. Gets the data declaration with the specified name. |
Project.UndoContext.BeginUndoStep("RsDataDeclarationCollection"); try { Station station = Station.ActiveStation; // Get the RsDataDeclarationCollection for the ActiveTask. RsDataDeclarationCollection ddCol = station.ActiveTask.DataDeclarations; RsRobTarget rbt = new RsRobTarget(); rbt.Name = station.ActiveTask.GetValidRapidName("MyRobTarget", "_", 1); String robTargetName = rbt.Name; ddCol.Add(rbt); // Output some info of the DataDeclaration in the logger. Logger.AddMessage(new LogMessage("The RsDataDeclarationCollection on the active task contains:")); foreach (RsDataDeclaration dd in ddCol) { Logger.AddMessage(new LogMessage("DataDeclaration: " + dd.Name + " with type: " + dd.TypeDisplayName)); } // Check that RsDataDeclarationCollection contains the RobTarget that was added. if (station.ActiveTask.FindDataDeclarationFromModuleScope(robTargetName, rbt.ModuleName) != null) { Logger.AddMessage(new LogMessage("The RsDataDeclarationCollection contains " + robTargetName)); } RsDataDeclaration rbt2; try { rbt2 = station.ActiveTask.FindDataDeclarationFromModuleScope("MyRobTarget_2", rbt.ModuleName); if (rbt2 != null) { Logger.AddMessage(new LogMessage("Found MyRobTarget_2")); } else { Logger.AddMessage(new LogMessage("Did not find MyRobTarget_2")); } } catch (ArgumentException e) { Logger.AddMessage(new LogMessage("The error: '" + e.Message + "' occured when trying to get 'MyRobTarget_2'")); } // Remove MyRobTarget_1 from the collection. ddCol.Remove(rbt); } catch { Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback); throw; } finally { Project.UndoContext.EndUndoStep(); }