Select Revit Object by id and change parameters - c#

Hi I want to select a revit object by id and change a parameter to the value i want in c#. Can you give me a code example how to do that? It can be any parameter, I just would like to see a rough pattern to lean on.
Im using Visual Studio and an Addin in Revit.

Related

winappdriver get Data from System.Data.DataRowView

I am writing an UI Test for a Windows Forms application, up untill now I was able to extract the nessesary information for the Tests with the Windows Kit inspect tool
The Inspector Tool
now my problem is, I got the following list, but I cant get the text of the list item. Normally the text of an element is the property Name but in this list its just "System.Data.DataRowView"
The List in the UI
for anyone corious, this is how im getting the element (C#)
WindowsElement element = driver.FindElementByName("System.Data.DataRowView");
and this is how it looks like in the Debugger:
Just found out it is not possible, this issiue on the github repository describes it:
https://github.com/microsoft/WinAppDriver/issues/1475
The only workarounds are screnshoting and extracting the Text with OCR

Attempting to add a Yes/No data type Field in table in Visual Studio 2010

Maybe someone can help me. As part of a college project I am attempting to design a number of tables within MS Visual Studio. We had previously designed these tables using Microsoft Access and one of the fields had a data type of Yes/No. In other words the data which was been saved to the particular field in the table would only contain a yes/No value.
Is there any way to replicate such a data type in Microsoft Visual studio. We are using an SQL server database and I am able to create the table but the only thing I am unable to do is to set the value type to replicate the yes/No value in Access. I would have assumed there would be an option to set values as boolean data type but this option is not present.
To clarify the version of Visual Studio is 2010 Professional and we are building the particular tables in C#.
Can anyone advise on an alternative option to Yes/No which will still return a true/false value or even a 0/1 value would do fine.
In SQL Server you can use a bit column: http://msdn.microsoft.com/en-us/ms177603
There is the data layer where the data is stored (your DB) and there you can set tinyint or bit as your datatype (assuming you are in MS SQL since you are in in VS an C#)
And there is also the presentation and application layer where in (case you are not in WPF) are in the same .cs, where you can define a radiobutton or checkBox control find in VS 2010 toolbox, to show the corresponding data.

Let the use edit and view an array of text values in C# (Visual Studio 2008)

I'm going to write a small linear programming solver.
The GUI will allow the user to edit a table of string values.
What is the neatest way to accomplish that in a C# Winform?
The development tool is Visual Studio 2008.
http://www.fileguru.com/GIPALS32---Linear-Programming-Library/screenshot
You can use a DataGridView control with a DataTable or something similar.

Can you Create a Keynote using the Revit API in C#

I'm trying to create a Keynote Tag via the Revit 2012 API. However, I found now reference to creating a Keynote Tag anywhere on the internet or in the samples. I see that the BuiltInCategory.OST_KeynoteTags is part of the IndependentTag class and according to http://thebuildingcoder.typepad.com/files/guide-to-placing-family-instances-with-the-api.doc you need to use the TM_ADDBY_CATEGORY TagMode to create a Keynote. However, when you then try to change the new Tag via ChangeTypeId, you get an error.
Has anyone figured this out?
I haven't had a chance to try yet, but I'm thinking you're out of luck.
For the most part, you can't do things with the API that you can't do interactively in Revit. I did quickly test that you can't change the type of a multi-category tag to be a keynote tag.
While they're both IndependentTag elements, they are different Categories, and it's very rare in my experience where you can switch the category of a placed element.

Getting following error while running application

I have an application developed in C Sharp, which is executed in QTP but i get the following error:
Cannot identify the object "2" (of class WinObject). Verify that this object's properties match an object currently displayed in your application.
Can anyone help me resolve it?
If the application is developed in C# make sure you have the .NET addin loaded, then the object should be SwfObject rather than WinObject.
In any case use the object spy to point at the control you think should match the test object in the test and see how its properties differ (you can also use the update from application button from the object repository).

Categories