mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-15 18:14:02 +00:00
replaced Revit 2020 SDK by Revit 2021 SDK
This commit is contained in:
@@ -25,7 +25,7 @@ using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.UI.Events;
|
||||
using Autodesk.Revit.DB.Steel;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using Autodesk.AdvanceSteel.CADLink.Database;
|
||||
|
||||
@@ -25,7 +25,7 @@ using Autodesk.Revit.UI.Selection;
|
||||
using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using System.Collections.Generic;
|
||||
@@ -81,7 +81,7 @@ namespace Revit.SDK.Samples.SampleCommandsSteelElements.CreateAnchorPattern.CS
|
||||
{
|
||||
// We create the anchor pattern using Advance Steel classes and objects only.
|
||||
// for more details, please consult http://www.autodesk.com/adv-steel-api-walkthroughs-2019-enu
|
||||
HashSet<FilerObject> filerObjectHashSet = new HashSet<FilerObject>();
|
||||
List<FilerObject> filerObjectList= new List<FilerObject>();
|
||||
FilerObject filerObj = Utilities.Functions.GetFilerObject(doc, eRef);
|
||||
|
||||
if (null == filerObj)
|
||||
@@ -89,13 +89,13 @@ namespace Revit.SDK.Samples.SampleCommandsSteelElements.CreateAnchorPattern.CS
|
||||
return Result.Failed;
|
||||
}
|
||||
|
||||
filerObjectHashSet.Add(filerObj);
|
||||
filerObjectList.Add(filerObj);
|
||||
|
||||
// Point of reference for the anchor pattern. We use GlobalPoint to create the pattern on the plate. GlobalPoint is the point where the plate is being hit when selected.
|
||||
Point3d p1 = new Point3d(eRef.GlobalPoint.X, eRef.GlobalPoint.Y, eRef.GlobalPoint.Z);
|
||||
Point3d p2 = new Point3d(p1.x + 0.5, p1.y + 0.5, p1.z + 0.5);
|
||||
AnchorPattern anchorPattern = new AnchorPattern(p1 * Utilities.Functions.FEET_TO_MM, p2 * Utilities.Functions.FEET_TO_MM, new Vector3d(1, 0, 0), new Vector3d(0, 1, 0));
|
||||
anchorPattern.Connect(filerObjectHashSet, Autodesk.AdvanceSteel.ConstructionTypes.AtomicElement.eAssemblyLocation.kOnSite);
|
||||
anchorPattern.Connect(filerObjectList.ToArray(), Autodesk.AdvanceSteel.ConstructionTypes.AtomicElement.eAssemblyLocation.kOnSite);
|
||||
anchorPattern.WriteToDb();
|
||||
|
||||
trans.Commit();
|
||||
|
||||
@@ -25,7 +25,7 @@ using Autodesk.Revit.UI.Selection;
|
||||
using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using System.Collections.Generic;
|
||||
@@ -83,17 +83,17 @@ namespace Revit.SDK.Samples.SampleCommandsSteelElements.CreateBoltPattern.CS
|
||||
{
|
||||
// Creating the bolt pattern using AdvanceSteel's classes and objects.
|
||||
// for more details, please consult http://www.autodesk.com/adv-steel-api-walkthroughs-2019-enu
|
||||
HashSet<FilerObject> filerObjectHashSet = new HashSet<FilerObject>();
|
||||
List<FilerObject> filerObjectList = new List<FilerObject>();
|
||||
FilerObject filerObj = Utilities.Functions.GetFilerObject(doc, eRef);
|
||||
if (null == filerObj)
|
||||
{
|
||||
return Result.Failed;
|
||||
}
|
||||
|
||||
filerObjectHashSet.Add(filerObj);
|
||||
filerObjectList.Add(filerObj);
|
||||
|
||||
FinitRectScrewBoltPattern boltPattern = new FinitRectScrewBoltPattern(p1 * Utilities.Functions.FEET_TO_MM, p2 * Utilities.Functions.FEET_TO_MM, new Vector3d(1, 0, 0), new Vector3d(0, 1, 0));
|
||||
boltPattern.Connect(filerObjectHashSet, Autodesk.AdvanceSteel.ConstructionTypes.AtomicElement.eAssemblyLocation.kOnSite);
|
||||
boltPattern.Connect(filerObjectList.ToArray(), Autodesk.AdvanceSteel.ConstructionTypes.AtomicElement.eAssemblyLocation.kOnSite);
|
||||
boltPattern.WriteToDb();
|
||||
|
||||
trans.Commit();
|
||||
|
||||
@@ -26,7 +26,7 @@ using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.Revit.DB.Steel;
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -25,7 +25,7 @@ using Autodesk.Revit.UI.Selection;
|
||||
using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.Revit.DB.Steel;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -25,7 +25,7 @@ using Autodesk.Revit.UI.Selection;
|
||||
using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.AdvanceSteel.CADLink.Database;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
@@ -25,7 +25,7 @@ using Autodesk.Revit.UI.Selection;
|
||||
using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.AdvanceSteel.Arrangement;
|
||||
using Autodesk.AdvanceSteel.Contours;
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
using Autodesk.Revit.UI.Selection;
|
||||
using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.AdvanceSteel.Arrangement;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
@@ -25,7 +25,7 @@ using Autodesk.Revit.UI.Selection;
|
||||
using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.Revit.DB.Steel;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -26,7 +26,7 @@ using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.Revit.DB.Steel;
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.UI;
|
||||
using System.Collections.Generic;
|
||||
@@ -114,9 +114,9 @@ namespace Revit.SDK.Samples.SampleCommandsSteelElements.CreateWeldPoint.CS
|
||||
if (null != weld)
|
||||
{
|
||||
weld.WriteToDb();
|
||||
HashSet<FilerObject> objsToConnect = new HashSet<FilerObject>();
|
||||
List<FilerObject> objsToConnect = new List<FilerObject>();
|
||||
objsToConnect.Add(filerObj);
|
||||
weld.Connect(objsToConnect, Autodesk.AdvanceSteel.ConstructionTypes.AtomicElement.eAssemblyLocation.kInShop);
|
||||
weld.Connect(objsToConnect.ToArray(), Autodesk.AdvanceSteel.ConstructionTypes.AtomicElement.eAssemblyLocation.kInShop);
|
||||
}
|
||||
|
||||
trans.Commit();
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
None
|
||||
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -18,7 +12,7 @@
|
||||
<AssemblyName>SampleCommandsSteelElements</AssemblyName>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -29,8 +23,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DocumentationFile>bin\Debug\SampleCommandsSteelElements.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -94,4 +87,4 @@
|
||||
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
|
||||
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -8,7 +8,7 @@ using Autodesk.Revit.UI.Selection;
|
||||
using Autodesk.AdvanceSteel.CADAccess;
|
||||
using Autodesk.AdvanceSteel.Geometry;
|
||||
using Autodesk.AdvanceSteel.Modelling;
|
||||
using RvtDwgAddon;
|
||||
using Autodesk.SteelConnectionsDB;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.Structure;
|
||||
using Autodesk.Revit.UI;
|
||||
@@ -25,6 +25,22 @@ namespace Revit.SDK.Samples.SampleCommandsSteelElements.UpdateConnectionDetailed
|
||||
[Autodesk.Revit.Attributes.Journaling(Autodesk.Revit.Attributes.JournalingMode.NoCommandData)]
|
||||
public class Command : IExternalCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// Implement this method as an external command for Revit.
|
||||
/// </summary>
|
||||
/// <param name="commandData">An object that is passed to the external application
|
||||
/// which contains data related to the command,
|
||||
/// such as the application object and active view.</param>
|
||||
/// <param name="message">A message that can be set by the external application
|
||||
/// which will be displayed if a failure or cancellation is returned by
|
||||
/// the external command.</param>
|
||||
/// <param name="elements">A set of elements to which the external application
|
||||
/// can add elements that are to be highlighted in case of failure or cancellation.</param>
|
||||
/// <returns>Return the status of the external command.
|
||||
/// A result of Succeeded means that the API external method functioned as expected.
|
||||
/// Cancelled can be used to signify that the user cancelled the external operation
|
||||
/// at some point. Failure should be returned if the application is unable to proceed with
|
||||
/// the operation.</returns>
|
||||
public virtual Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
||||
{
|
||||
UIDocument activeDoc = commandData.Application.ActiveUIDocument;
|
||||
|
||||
Reference in New Issue
Block a user