copied Revit 2024 SDK

This commit is contained in:
Jeremy Tammik
2023-04-26 14:47:47 +02:00
parent 2ca39e38fd
commit 4d69f3eea5
425 changed files with 344414 additions and 2296 deletions
@@ -41,8 +41,12 @@ namespace Revit.SDK.Samples.RebarFreeForm.CS
using (Transaction tran = new Transaction(doc, "Add shared param"))
{
tran.Start();
// Add Shared parameters:
// Update is a simple boolean.
// CurveElementId is an ElementId, which is a 64-bit Entity, so stringify it to keep data intact.
bool paramsAdded = AddSharedTestParameter(commandData, m_paramName, SpecTypeId.Boolean.YesNo, false);
paramsAdded &= AddSharedTestParameter(commandData, m_CurveIdName, SpecTypeId.Int.Integer, true);
paramsAdded &= AddSharedTestParameter(commandData, m_CurveIdName, SpecTypeId.String.Text, true);
if (paramsAdded)
{
tran.Commit();
+1 -1
View File
@@ -146,7 +146,7 @@ namespace Revit.SDK.Samples.RebarFreeForm.CS
if (newSharedParam != null && newSharedParam2 != null)
{
newSharedParam.Set(0);
newSharedParam2.Set(curveElem == null ? -1 : curveElem.Id.IntegerValue);
newSharedParam2.Set(curveElem == null ? ElementId.InvalidElementId.ToString() : curveElem.Id.ToString());
RebarFreeFormAccessor accesRebar = rebar.GetFreeFormAccessor();
accesRebar.AddUpdatingSharedParameter(newSharedParam.Id);
@@ -46,7 +46,7 @@ namespace Revit.SDK.Samples.RebarFreeForm.CS
Parameter paramCurveId = bar.LookupParameter(AddSharedParams.m_CurveIdName);
if (paramCurveId == null)
continue;
ElementId id = new ElementId(paramCurveId.AsInteger());
ElementId id = ElementId.Parse(paramCurveId.AsString());
if (id == ElementId.InvalidElementId)
continue;
if (modifiedIds.Contains(id))// if id of line is in the rebar, then trigger regen
@@ -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>
@@ -39,6 +33,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
@@ -71,7 +66,7 @@
</Target>
-->
<PropertyGroup>
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.pl"
if exist %25FILEFORSAMPLEREG%25 perl %25FILEFORSAMPLEREG%25 $(ProjectExt) "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
<PostBuildEvent>set FILEFORSAMPLEREG="$(SolutionDir)..\..\..\..\Regression\API\SDKSamples\UpdateSampleDllForRegression.py"
if exist %25FILEFORSAMPLEREG%25 py -3 %25FILEFORSAMPLEREG%25 "$(ProjectPath)" "$(TargetPath)" "$(SolutionDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
@@ -493,7 +493,7 @@ namespace Revit.SDK.Samples.RebarFreeForm.CS
Parameter paramCurveId = bar.LookupParameter(AddSharedParams.m_CurveIdName);
if (paramCurveId == null)
return null;
ElementId id = new ElementId(paramCurveId.AsInteger());
ElementId id = ElementId.Parse(paramCurveId.AsString());
return data.GetDocument().GetElement(id) as CurveElement;
}
/// <summary>