Skip to content

Commit

Permalink
many different changes and new commands added, sorry
Browse files Browse the repository at this point in the history
  • Loading branch information
baleti committed Dec 20, 2024
1 parent a1eef0f commit 07296b1
Show file tree
Hide file tree
Showing 15 changed files with 1,566 additions and 16 deletions.
2 changes: 1 addition & 1 deletion KeyboardShortcuts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<ShortcutItem CommandName="External Tools:SwitchView" CommandId="e19b084b-4a63-84af-a876-ec308252335e" Shortcuts="WW" Paths="Add-Ins&gt;External" />
<ShortcutItem CommandName="External Tools:CloseCurrentView" CommandId="e19b494b-4a63-44af-a876-ec308252335e" Shortcuts="WQ" Paths="Add-Ins&gt;External" />
<ShortcutItem CommandName="External Tools:CloseViews" CommandId="e19b494b-4a63-47af-a876-ec308252335e" Shortcuts="WC" Paths="Add-Ins&gt;External" />
<ShortcutItem CommandName="External Tools:FamilyReferences" CommandId="e19b494b-4a63-45af-a876-ec308252335e" Shortcuts="FV" Paths="Add-Ins&gt;External" />
<ShortcutItem CommandName="External Tools:FamilyReferences" CommandId="e19b494b-4a63-45af-a876-ec308252335e" Paths="Add-Ins&gt;External" />
<ShortcutItem CommandName="External Tools:CopyStructuralFoundationsFromLinkedModel" CommandId="e39b494b-4a63-45af-a876-ec308252335e" Paths="Add-Ins&gt;External" />
<ShortcutItem CommandName="External Tools:CutGeometryWithGroup" CommandId="e39b494b-4a63-45af-a876-ec308252535e" Paths="Add-Ins&gt;External" />
<ShortcutItem CommandName="External Tools:SynchronizeViews" CommandId="e39b494b-4a63-45af-b876-ec308252535e" Shortcuts="AA" Paths="Add-Ins&gt;External" />
Expand Down
23 changes: 23 additions & 0 deletions app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
53 changes: 53 additions & 0 deletions changelog.org
Original file line number Diff line number Diff line change
Expand Up @@ -802,3 +802,56 @@ customgui.datagrid1 works fine
**** =00:00= setup git repo, initial commit
**** =15:57= fixed || OR and whitespace AND operators in DataGrid2
likely will move detailed changes to git log from now on
** November
*** 11
**** =13:28= tried adding Folder Sheet column to OpenViews command, but nothing worked
need to revisit it later
*** 12
**** =22:38= tried adding SwithProject (or SwitchDocument) command, but it looks like it doesn't work for documents loaded from Autodesk Cloud (bim360)
I don't expect this to be solved any time soon
[[https://chatgpt.com/share/6733d7e4-2090-800c-b48b-8553d1578bae][chatgpt]]
likely will end up holding revit models in two separate revit processes and find another way to share data between them other than clipboard
** December
*** 12
**** =23:09= couldn't edit position of a callout head
couldn't find any way to access it via revit api
it would be useful, because its position resets each time it's copied and has to be manually repositioned
there may be many hundreas of callouts on a project
=23:22= confirmed that it's unavailable in revit 2024 api now
[[revit idea][https://forums.autodesk.com/t5/revit-ideas/allow-setting-of-callout-head-location-in-api/idi-p/10665304]]
*** 13
**** =10:48= added "SelectModelGroupsWithParameters" command
forgot that "SelectModelGroups" already existed and behaves largely the same with exception that the new command also displays all parameters
*** 16
**** =19:44= tried writing a command to autoplace MaterialKeynotes, but failed
[[chatgpt][https://chatgpt.com/share/67608357-c920-800c-b889-d62f09f1d50a]] suggested only placing IndependentTags, but these don't pick up needed parameters
[[revit idea][https://forums.autodesk.com/t5/revit-ideas/revit-api-material-keynotes/idi-p/13214525]]
*** 17
**** =11:35= added "SetParametersOfFamilyTypes" and "SetParametersOfSelectedInstances" commands
they should prove universally useful for a number of tasks
I was hoping to use them specifically to set parameters to material elements to avoid waiting for them to reload individually, but each parameter would have a different value and this command can only set the same value to multiple family types or family instances at the moment
***** future improvement idea potentially would be to make entries in table individually editable to be able to input multiple different values in a single transaction
or I might just use ideate
this pretty much replicates ideate functionality
***** =11:52= improved "SetParametersOfFamilyTypes" command by letting previous windows make multiple selections and these selections to them be combined in subsequent lists
for example some parameters are shared by family types in multiple categories, e.g. we've had material for louvres in both doors and window family types
*** 18
**** =18:00= looking into "copy/pasting" action between different revit sessions
using InsideClipboard from NirSoft I confirmed that Revit doesn't use system clipboard at all
need to find a way to replicate this behavior cross-process
1. export/import elements associated family types, line styles etc.
2. place them at specific positions
I will start with view-dependent elements first
***** [2024-12-19 Thu 01:35] was able to automate export and import of families of selected elements between sessions, but basic placement wasn't right, elements kept showing up in wrong positions and wrong orientations
***** =15:27= losing hope this will work due to complex nature of revit elements
[[revit forum thread][https://forums.autodesk.com/t5/revit-api-forum/recreate-elements-between-revit-projects/td-p/13220620]]
***** =20:58= lost access to gpt o1 and don't know how to continue on my own, leaving it for later
[[chatgpt][https://chatgpt.com/c/67642cda-3ef0-800c-b89e-aa1d7283bc31]]
***** =22:51= realized that there are builtin commands in revit already to save as "library" group or view and corresponding command to load/insert them
they may have some limitations that I haven't discovered yet, like placing them in the same location as in the original file
in these situations my Copy/PasteCrossSession commands may still prove useful
while they are not perfect, they correctly place most of detail items in same locations
they are fairly convenient, invoking any one of them automatically select currently selected group or currently active window
it may still worth though to write separarate commands to perform bulk exports to avoid having to open entire project in the future when certain detail items are needed
*** 19
**** =13:58= minor fix to "SelectAllElementsInView" command to prevent it from selecting views
8 changes: 8 additions & 0 deletions packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
<package id="System.Buffers" version="4.6.0" targetFramework="net48" />
<package id="System.Memory" version="4.6.0" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net48" />
</packages>
2 changes: 1 addition & 1 deletion readme.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#+title: revit-scripts

** Productivity tools for revit architecture.
** Productivity tools for revit architecture
*** Switch/close/open views and sheets
[[https://github.com/baleti/revit-scripts-demos/blob/8142cd312030378ed0b2543ad563b8514dbf9d5a/OpenViews.gif]]
*** Invoke commands
Expand Down
31 changes: 30 additions & 1 deletion revit-scripts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="RevitAPI">
<HintPath>..\..\..\..\..\..\Program Files\Autodesk\Revit 2024\RevitAPI.dll</HintPath>
Expand All @@ -59,21 +63,39 @@
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="revit-scripts\3DSectionBoxFromView.cs" />
<Compile Include="revit-scripts\CloseCurrentView.cs" />
<Compile Include="revit-scripts\CloseViews.cs" />
<Compile Include="revit-scripts\CopyCrossSession.cs" />
<Compile Include="revit-scripts\CopyStructuralFoundationsFromLinkedModel.cs" />
<Compile Include="revit-scripts\CreateDraftingViewsFromSheetNames.cs" />
<Compile Include="revit-scripts\DataGrid1.cs" />
<Compile Include="revit-scripts\CutGeometryWithGroup.cs" />
<Compile Include="revit-scripts\DataGrid2.cs" />
<Compile Include="revit-scripts\DeleteRevisionCloudsFromSheets.cs" />
<Compile Include="revit-scripts\DeselectRandomly.cs" />
<Compile Include="revit-scripts\DrawCircleAtOrigin.cs" />
<Compile Include="revit-scripts\DrawCropRegion.cs" />
<Compile Include="revit-scripts\PasteCrossSession.cs" />
<Compile Include="revit-scripts\PlaceMaterialKeynote.cs" />
<Compile Include="revit-scripts\SelectFamilyTypesInCurrentView.cs" />
<Compile Include="revit-scripts\SelectFamilyTypesInProject.cs" />
<Compile Include="revit-scripts\SelectFamilyTypeInstancesInCurrentView.cs" />
Expand All @@ -90,6 +112,9 @@
<Compile Include="revit-scripts\SelectAssociatedDimensions.cs" />
<Compile Include="revit-scripts\SelectDoubleSwitchedSocketOutletInLink.cs" />
<Compile Include="revit-scripts\SelectModelGroup.cs" />
<Compile Include="revit-scripts\SelectModelGroupsWithParameters.cs" />
<Compile Include="revit-scripts\SetParametersOfFamilyTypes.cs" />
<Compile Include="revit-scripts\SetParametersOfSelectedInstances.cs" />
<Compile Include="revit-scripts\SetParameterValueToSelectedFamilyTypesInCurrentFamily.cs" />
<Compile Include="revit-scripts\SetRevisionsToCurrentSheet.cs" />
<Compile Include="revit-scripts\SetRevisionsToSheetsWhereRevisionIsByCloud.cs" />
Expand All @@ -107,7 +132,7 @@
<Compile Include="revit-scripts\ExportSchedule.cs" />
<Compile Include="revit-scripts\ExportViewTemplatesToRvt.cs" />
<Compile Include="revit-scripts\ListSheetsByDetailItemSelected.cs" />
<Compile Include="revit-scripts\IncrementSelectedSheetNumbers.cs" />
<Compile Include="revit-scripts\IncrementSheetNumbers.cs" />
<Compile Include="revit-scripts\InvokeAddinCommand.cs" />
<Compile Include="revit-scripts\InvokeRevitCommand.cs" />
<Compile Include="revit-scripts\ListChildViews.cs" />
Expand Down Expand Up @@ -154,6 +179,10 @@
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if "$(ConfigurationName)" == "Release" (
Expand Down
Loading

0 comments on commit 07296b1

Please sign in to comment.