I am writing a plugin for Revit 2014. One of its features placing a vertical column by the user. Revit API allows placing family instances by the user with the method PromptForFamilyInstancePlacement, which is what I'm using, like so:
//PillarSymbols is a list containing symbols of various columns available, loaded previously from a file
FamilySymbol symbol = PillarsSymbols.Single(x => x.Kind == selected.Kind).Symbol;
_commandData.Application.ActiveUIDocument.PromptForFamilyInstancePlacement(symbol);
This code enables Modify | Place structural column tool in Revit application. It works as desired, but does not allow the user to switch between Vertical Column and Slanted Column. This option is set to whatever it was set before running the code above.
I have tried to set the symbol parameters before running PromptForFamilyInstancePlacement using:
symbol.get_Parameter(BuiltInParameter.SLANTED_COLUMN_TYPE_PARAM).Set(value);
but get_Parameter() above returns null.
Is there a method to set column type to Vertical Column, before prompting the user to place the column? Also is there a way to pre-set column height?
Unfortunately you can't preset the column height but you can adjust the free end of the item created directly afterwards. You should be returning a FamilyInstance, so if you grab it again then you can adjust the free end of it.
You may be able to prompt the user to place the correct symbol by cycling through the symbols in the family. Try the snippet below and check to make sure that the symbol produced is the one that you want before placement:
FamilySymbol familySymbol = family.Symbols.ForwardIterator().Current as FamilySymbol;
Related
In our database, User Defined Fields in the Production Order rows define linked Production Orders and Purchase Orders. The columns for these fields on the Production Order window really should have golden link arrows.
If I created the columns myself, I would set the LinkedObjectType properly and the arrows would appear. However, in this case the B1 client creates the columns automatically. I need to get them and add the link arrows after form creation has completed.
The Production Order items grid is a Matrix, which offers the Columns property, so I can retrieve any column I want; however, it is returned as a plain Column object, not an EditTextColumn, so the LinkedObjectType property I need to set is not available. Attempting to cast the Column to an EditTextColumn simply causes an exception.
What is the correct way to add link arrows to a UDF column on the Production Order screen's matrix?
You can update user defied field and set Validation to Linked to entities.
I'm trying to fill a table using the selenium drivers and all the documentations I could find only shows how to retrieve data from the cells. I'm able to access my table cells using:
var rows = Driver.FindElement(By.Id("Products")).FindElements(By.XPath("id('Products')/tbody/tr"));
var cells = tableRows[1].FindElements(By.XPath("td"));
But I couldn't find any way to update the data that's in it. The "Text" property only has a Get method and the SendKeys() function doesn't work. How can I edit the cell's value?
As a side note, my cell contains an html "input", I've tried to access it with the FindElement function of the cell but for some reasons it cannot find it.
Generally speaking, SendKeys should work if the cell indeed contains the input element. But because you're also saying that you fail to find the input element, I suspect that the input element does not exist in each cell all the time. You should probably first click on the cell in order for the input element to appear on that cell. You should be able to verify it using the Dev Tools if you inspect the element before clicking it.
IWebElement doesn't provide a method to change text, but you could use a little bit of JS - something little like :
((IJavaScriptExecutor)Driver).ExecuteScript("document.getElementByXXXXX.innerHTML = "VALUE";");
https://seleniumhq.github.io/selenium/docs/api/dotnet/html/M_OpenQA_Selenium_IJavaScriptExecutor_ExecuteScript.htm
I've created a C# Windows Forms application in .NET. It has a main form. Main form has a ListView control with four columns as below:
First Name
Last Name
Age
Gender
I populate the list view with 1 row with following values
First Name - Rasik
Last Name - Bihari
Age - 32
Gender - Male
Here is the screenshot:
I'm trying to test its accessibility for specially-abled users through JAWS screen reader tool. The issue is that whenever I select one of the rows it reads only the value of all the column values one by one. It doesn't read the header text along with it. My expectation is that it should read like -
First Name : Rasik
Last Name : Bihari
Age : 32
Gender : Male
JAWS support some keyboard shortcuts to have this behavior explicitly. Like if you press Insert + Ctrl + 1 then it will read the value of first column like this -
First Name : Rasik
If you press Insert + Ctrl + 2 then it will read the value of second column like this -
Last Name : Bihari
I want this behavior by default so that as soon we select a row in the ListView control i.e. it should read the entire row in 'column header text' : 'column value' pairs.
Does anyone has any clue on this if there is any property of listView control which need to be set or any setting in JAWS which can be of help?
If you are looking for a sample behavior then open Visual Studio -> Go to Debug Menu -> Click Attach to Process menu item. In Attach to Process window there is a group box Available Processes which shows the list of all available processes to which you can attach your code. It is also a ListView control. When I run JAWS with Visual Studio, on this window it reads all the column header text and column value pairs one by one when I select a row by mouse. I expect the same behavior for my application also.
But on the same machine JAWS is behaving differently for my application.
I was able to figure this out myself. There was no additional coding required to achieve it. Actually JAWS by default suppresses this reading behavior through its configuration. You need to configure JAWS explicitly to read the rows of a list view in <Column Header> - <Column Value> fashion.
When your application is running and the current focus is on a list view control on the form being displayed, press JAWS KEY + F2. It opens JAWS manager popup showing a list of what all items can be configured. Choose second option Customize ListView and press OK (Refer screenshot):
On the Customize Headers window you will see that currently Ignore radio button is selected (Refer screenshot):
Change the radio button selection to the appropriate option to alter the screen reading behavior for ListView control.
The most irritating issue is that this configuration needs to be done separately for every list view control appearing in your application. There is no centralized mechanism to configure it in one go for your entire application.
Note: Since by default JAWS is configured to read only column values, this means that it is appropriate for specially abled users. Freedom scientific must have researched around it as reading the column headers might be extraneous/trivial information which is not desired at once.
Also, if the specially abled user wants to read the column headers then JAWS KEY + Ctrl + Column Header Index keyboard shortcut is always available to read it in that format.
Note: Different screen reader tools like Thunder, NVA behave differently while reading a ListView.
I have a data grid view in c# for a basic crossword game. To the left of the first column, titled "#" is a space, I can't seem to remove it, it is defiantly not a column that is recognized by Visual Studio... I just want to get rid of it.
that's a default column number space. remove your # column and take advantage of default functionality
Its was a default column number space, as user RadioSpace helpfully pointed out!!!
how to hide columns in crystal report at run time?
thanks for any suggistions.
Option 1: use conditional-suppression logic to hide/show redundant fields
Use a parameter field to drive the suppression formulae for the desired fields.
If you want to eliminate blank spaces between fields, then you'll need to stack the fields on top of each other and suppress them appropriately. In your example, column 2 would contain field2 and field3 (both suppressed) and column 3 would contain field2 and field3 (both suppressed). The suppression logic, in your example, would continue to suppress both fields in column 2, but would show field3 in column 2 (field2 in column 2 would still be suppressed).
Option 2: use 'placeholder' formula field
Each column of data that could be suppressed would be a formula field. Each formula field would use SELECT CASE logic to choose the desired field to display. A 'hidden' field would simply return a null value. Your SELECT CASE logic would be written to ensure that values are filled from left to right. The formatting will need to be done in the formula rather than on the formula field itself.
Option 3: use the SDK to dynamically-change the report.
Use the CR .Net SDK or the older CRAXDRT API to dynamically-modify the columns' visibility and positioning.
If you use this option, however, your deployment options will be more restricted.
You could use parameters (which values can be set during runtime) and use them on the objects' suppress formula.
just for sharing I found a great and simple article at
http://www.codeproject.com/KB/cs/Dynamic_Crystal_Report.aspx
that using parameters in crystal report to dynamically load data from a database into Crystal Report and show specifying which field (Columns of a particular table) should be displayed in the repor according to user choice.
Dani.