I have done what you have said but somehow the form does not come out when I execute the code. What am I missing?
//Declare Winform
Form1 form = new Form1();
form.worksetsetting(worksetList);
form.Show();
I have done what you have said but somehow the form does not come out when I execute the code. What am I missing?
//Declare Winform
Form1 form = new Form1();
form.worksetsetting(worksetList);
form.Show();
I saw a plugin of revit for the purpose of showing a floating grid symbol that consistently stays on the edge of the window.
This only works in plan view.
Does anyone know how to implement such a function?
From what I understood, you want to create grid on the edge of the windows. That's feasible. First, learn how to create a grid, then learn how to get the edge of the window. Then compile them in a single code. You can access samples from Revit SDK Samples.
Good Luck,
Recep.
As I know, what you want is impossible. Revit API completely event-driven. Everything you called and did manage by Revit itself, not by you. So, unlike other APIs, Revit API implementation is completely different. I hope this article clarifies. I don't have much knowledge about that subject but that's what I know.
Difference between Revit and other APIs
"The Revit API is an Abomination"
Also, there is the same question in this link as yours.
Good Luck with everything,
Recep.
Hi Jeremy!
I'm not sure I understand how to set "Current Type" property before examining parameter values.
Here I've wrote a test code for checking how different parameters are retrieved from current Family Type. Some of the parameters actually work and return data I need (ALL_MODEL_TYPE_COMMENTS and RBS_ELEC_APPARENT_LOAD), but most throw ArgumentNullException (ALL_MODEL_TYPE_NAME, ALL_MODEL_FAMILY_NAME, FBX_LIGHT_INITIAL_COLOR_TEMPERATURE). I have no idea why some parameters are read and others aren't.
public LightingFixtureType GetListOfFamilyTypes(Document familyDoc) { if (familyDoc.IsFamilyDocument) { FamilyManager famManager = familyDoc.FamilyManager; FamilyType currentType = famManager.CurrentType; FamilyParameter param = famManager.get_Parameter(BuiltInParameter.ALL_MODEL_TYPE_NAME); string name = currentType.AsString(param); LightingFixtureType lft = new LightingFixtureType(name); return lft; } return null; }
Hello all,
I am creating a macro that batch upload models to the Revit server. But I want to skip files that already exist on the Revit Server. I am trying to check with BasicFileInfo.Extract(path) and then check if is null and encapsulate in a try-catch in case the file doesn't exist. But this is not working.
Is there an easier way to do this?
Many thanks
Can't you simply get all file names(Include that exist in the server) and compare them with the name of files that already exist in the server. This looks like a simple comparison test.
the problem is that as it is in the Revit server normal Windows system methods don't work. For example I can't get the files in the server with "GetFiles" or "File.Exist". If this was done locally in our file based server it would be very easy.
Thank you, Recep. That is a disappointing news. I guess we will just have to do this whole thing all over again.
What do you mean exactly with "Server", is it BIM360, an external database or your company's local database?
I don't get it, how you can upload a file but can't get the information of uploaded files? If everything seems impossible for now, I can suggest you create a log file that contains every information(Path, name etc.) obtained by BasicFileInfo and save it to log file. This solution is applicable even you can't get the name of the fille in the server.
Hope that helps,
Recep.
Hello,
Yes I guess I could create a txt external file with all the uploaded files and then compare with that list. That would work. thanks!
Hi
I'm struggling with monitoring Revit for element selection changes.
Window selections are no problem; monitoring element selection changes as a user "Control Picks" them is the main issue im working on a solution for. Way back Revit apparently had a "Element Selection Changed" Method but its been hidden/deprecated to the dismay of many in our community.
Because of this many in our community have come up with some great ideas to solve this seemingly rudimentary issue.
Specifically, detailed on Jeremy Tammicks awesome site The Building Coder, is this post which lays out the three most viable workarounds.
The one ive tried to implement is #3 which was originally suggested by a member of our community named Vilo here. Jeremy Tammick has made this code available for our use in the SDK Samples. Here is the repository of the current "working state" of my implementation.
Jeremy had great suggestions as usual but the issues below remain.
If you've found a solution to the main problem of "Element Selection Changed Monitoring" or to the implementation of Vilo's suggestion to subscribe to the Modify Tabs property changed event i, and i suspect many other, would appreciate some feedback.
Is there an easy way to create a color legend with paints/textures used on the exterior of a building ? I have tried creating walls made of only the paint/material and some show show up white in the legend. It seams the colors are lighter in the legend than on the elevations. See attached. Any thoughts?
AFAIK import scale factor is not retained within the project following its import.
A kludge could include a scale as text within the pattern name on import for later reference but this will not assist you with preexisting fills.
hth,
Hugh Adamson
www;hatchkit.com.au
This is Revit API forum, this forum is only for Revit API, coding questions. If you aren't trying to solve your problem programmatically, you should look at other Revit Forums.
The development team replies:
If anyone wants to look at the IFC open source UI , it uses WPF.
Happy New Year!
great, thanks!
You need to pass the variable when you intialize the form to begin with.
using(Form1 form = new Form1(WorksetList)) { if(form.Show == DiaglogResult.OK) { return Result.Succeded; } }
Then you just have to get the variable being sent in the Form Initialization and use it.