The Autodesk.Revit.DB.AssemblyMemberDifference
class represents the difference between two instances of Autodesk.Revit.DB.AssemblyMember
. It provides information about the changes made to the assembly members.
MemberType
- Gets the type of the assembly member that was modified.OldMember
- Gets the original instance of the assembly member.NewMember
- Gets the modified instance of the assembly member.ToString()
- Returns a string representation of the assembly member difference.// Create two assembly members
AssemblyMember originalMember = new AssemblyMember(/*...*/);
AssemblyMember modifiedMember = new AssemblyMember(/*...*/);
// Make some changes to the modified member
modifiedMember.ExcludeMember(/*...*/);
// Create an AssemblyMemberDifference object
AssemblyMemberDifference difference = new AssemblyMemberDifference(originalMember, modifiedMember);
// Get the member type of the difference
AssemblyMemberType memberType = difference.MemberType;
// Get the original and modified members
AssemblyMember original = difference.OldMember;
AssemblyMember modified = difference.NewMember;
// Output the changes made
Console.WriteLine("The following changes were made to the assembly member:");
Console.WriteLine(difference.ToString());
In this example, we create two AssemblyMember
objects and modify one. We then create an AssemblyMemberDifference
object to represent the changes made to the modified member. We use the properties to get information about the changes and output them to the console.
The Autodesk.Revit.DB.AssemblyMemberDifference
class is useful for comparing two instances of Autodesk.Revit.DB.AssemblyMember
and determining the changes made in between. It provides properties and methods to access information about the differences.