Posts

Showing posts from August, 2022

STUBS from GITHUB for Revit python methods exports

@eshan iran-nehad and @steve baher at McNeel came up with Python stubs Builder - I tried it but ended up using the GIT Iron Python Stubs for now. https://github.com/mcneel/pythonstubs on GIThub. The lnk goes through the process of setting up stubs based on the revit version. The original how-tom came off  Macro4BIM - but there were a few missing steps and I automated things a bit.  My Stubs was installed with PyRevit at C:\Users\[USER ID]\AppData\Roaming\pyRevit-Master\bin Readme on stubs here . Batch to run for revit 2022 would only run from the PyRevit folder and looks like: @ echo off setlocal set path = %path% ;C:\Users\rallen\AppData\Roaming\pyRevit-Master\bin cd c: cd %userprofile% \AppData\Roaming\pyRevit-Master\bin ::The Destination folder is the default folder ::Visual Studio Community 2022 uses for GIT Repos and code storage set Destination = " %userprofile% \source\repos\stubs\Autodesk.Revit.R22" ::This is the Source DLL and its SUBFOLDER used by the...

Visual studio update to PY 3.x wrecked my intellisense

Image
Following an update of my VS community to include python: and updated: I broke my python intellisense (seen in previous post). **STILL BROKEN : ( I created a project ILO just a file using the create using code image 1490×518 29 KB This creates a solution which allows access to python versions which is just a mirage: image 406×584 22.3 KB and everything seemed to be resolving again- but no intellisense. Just the errors went away. (Thank you Microsoft Visual Studio!) Dang- still broken - the solution creates stubs so the functions won't trip the errors, but doesn't install the intellisense. Reading up on STUBS here from a VS Coder https://docs.microsoft.com/en-us/visualstudio/python/editing-python-code-in-visual-studio?view=vs-2022 on GIT  https://github.com/python/mypy/wiki/Creating-Stubs-For-Python-Modules - After renaming it and pointint to the "top" reference it seems to work: Separate multiples with semicolons. Will need to ahve a clr, sys, system as well? Resolved...

Tool to create generic annotations in drafting views of type based on name

Image
Version 2.05 Working Gets all gen anos in project gets drafting view corresponding to the family name of the gen anno gets the types Creates the types in the drafting view to use as a reference for schedule manipulaiton Adding types after run: Family NEW added- Re-run: Need to resolve SORT... NEW should come after numbers! Update includes moving exsinting (sorted) annotations  to their exact spot in the list: ##https://gist.github.com/gtalarico/e6be055472dfcb6f597e3dcd20d11f37 #import System.Collections.Generic #from System.Collections.Generic import List ##clr.AddReference('RevitAPIUI') ##from Autodesk.Revit.UI import * import clr clr . AddReference ( 'System' ) clr . AddReference ( 'RevitAPI' ) ##clr.AddReference('RevitNodes') ##clr.ImportExtensions(Revit.Elements) ##clr.ImportExtensions(Revit.GeometryConversion) ###Creates a Drafting View### from Autodesk . Revit . DB import Transaction , Element , ElementTransformUtils ##https://...