Revit API: NewFamilyDocument - where to get the template? - revit-api

My code doc.Application.NewFamilyDocument(template_path); requires a path to a Revit family template. Currently we made a copy of, say "Metric Mass.rft" and redistribute this.
Is there a way to either/or
get the default path for these family templates
create a family document without the template
instead?

The default library paths are accessible via the GetLibraryPaths method. For examples of using it, please refer to the Revit SDK samples, e.g., RoutingPreferenceTools, UIAPI, RevitCommands, and The Building Coder samples external command CmdLibraryPaths, described in the article on Library Paths
.

Related

Is there a replacement for Bixby JavaScript API module textLib?

The Bixby Import and search template uses a library module textLib which throws an error due to the library having been deprecated. The template uses a javascript file named "transaction_util.js" that requires the library via var textLib = require('textLib'). The library contains functions that were used for various text-related functions for fuzzy matching.
Is there a replacement module or a workaround for this?
Sorry for the inconvenience. We had an emergency update to the template capsule. You can try it now and should use externalTextLib which is included in the template.
If you already started your coding, you may want to create a new template capsules, copy and paste code/lib/externalTextLib.js to your existing capsule and change the line to var textLib = require('externalTextLib'), which should work without any additional coding change.
Or start a new project with the new template. It might be a safer option.

Handling Excel Spreadsheets with Cucumber

I am planning to work on the Cucumber feature file with Groovy code (Katalon Studio) for step definitions. I wanted to use the excel file in Cucumber file or to see is there any other option to use it.
I have not yet tried as of now any other option. I am thinking just passing the cucumber step file without any parameter and then using the excel file with in the step definition and access excel file and get the corresponding value.
I see there is a post in this forum suggesting to use QMetry Automation Framework for this type of question. But it does not look like this will help on this or should I use the passing the row index from cucumber file and based on that retrieve the value. Please guide on this.
Handling excel spreadsheets with Cucumber Scenario Outline
You should know that this is not supported by Cucumber.
As specified in the FAQ:
"We advise you not to use Excel or csv files to define your test cases; using Excel or csv files is considered an anti-pattern.
One of the goals of Cucumber is to have executable specifications. This means your feature files should contain just the right level of information to document the expected behaviour of the system. If your test cases are kept in separate files, how would you be able to read the documentation?
This also means you shouldn’t have too many details in your feature file. If you do, you might consider moving them to your step definitions or helper methods. For instance, if you have a form where you need to populate lots of different fields, you might use the Builder pattern to do so."
If you are using cucumber java 5+ you can add qaf-cucumber dependency. It should work with groovy as well. It will enable to have examples from external source like CSV, XML, JSON, EXCEL, DB.

How to make downloadable File-type field in transformation -Kentico

Resently started to work with kentico 6.0 .
I have build custom document type with field of "File" type, where administartor can upload file.
Now i'm trying to build a transformation from where site users will be able to download this file:
(like zipped source code of projects in codeproject)
Is where a easy way to do it in kentico?
thanks
You likely need to look into the built-in Transformation methods available to you (found at /CMSHelp/index.html?newedit_transformation_methods.htm of your Kentico instance).
In this case, I think what you want is GetFileUrl(object attachmentGuidColumn)
You'd do something like <a href='<%#GetFileUrl("NameOfTheDataField")#>'>File</a>

Flexible customization - Generating word document using C#

Problem - Generate a word document from information retrieved from database.
My solution - Create a word document template add fields/tags in places where values need to be inserted. The template will require tables and charts as well. Using document reflector that comes with open office xml sdk reflect on the document template and extract the w:document section and port it to C#. The rest of the logic revolves simply around finding the fields/tags, replacing them, etc. Very simple approach but not very flexible!
Challenge - I want the user to have the ability to customize the template or the generated document output. But this will not be possible if I embed the template logic in code.
Any other possibilities - I looked around at Templating using T4 and RazorEngine but could not find any concrete examples of how to create word documents using these two technologies.
Now what is the best approach?
I would really appreciate your inputs on what is the best and most flexible way to generate word documents using C#.
I'm actually working a project where the business users are designing word template with mail merge fields and we are populating the values using a 3rd party software package Aspose Words. http://www.aspose.com/categories/.net-components/aspose.words-for-.net/default.aspx
The software includes a library for merging data from datatables into the mail merge fields in the word document.
I also wrote a customized word task pane add in that retrieves data views from the database and lists the fields in a drag/drop interface that mimics a crystal or sql report writing interface.
Probably would of been easier to just use crystal or sql reporting though...
It's certainly possible to generate the contents of an Office doc using T4 or Razor and then package it up. The TestScribe powertool for Visual Studio Test Manager does just that with T4. There is a thread by Sally Cavanagh in the Q&A on this page http://visualstudiogallery.msdn.microsoft.com/e79e4a0f-f670-47c2-9b8a-3b6f664bf4ae that suggests a way to look at the T4 templates that it uses, which might get you jump-started.
Here is sample to play word document template with C#
You could use a content control databinding approach.
XML Mapping Task Pane for Word 2007/2010 is an authoring tool.
To create an instance document, you just attach your XML data file.
If the resulting documents will be opened in Word, that is all that is required: Word will bind the data itself. If your consuming application is not Word, you might want to resolve the bindings yourself (eg via Open XML SDK).
Content control databinding isn't intended to support repeats and conditionals. For a way to do that, look at my OpenDoPE convention
Take a look at Templater. Disclamer: I'm the author.
Check out JODReports or Docmosis. They are Java based but some of the templating features and output options might be ideal. You can call the command line interfaces unless they also have something better to reach from C#.

where to add the c sharp code in this example to make changes in sharepoint programmatically?

i am trying to programmatically do some changes in sharepoint as per the link below
in the link below there is a the second cod snippet is a C sharp code. where do i put this code ? or how can i use this code in sharepoint is not mentioned .. can anyone please tell me ?
http://weblogs.asp.net/wesleybakker/archive/2009/03/05/select-multiple-list-items-in-sharepoint-feature.aspx
I haven't tried any of the code out in the post you linked to, but it looks like the C# code just needs to be compiled into an assembly and deployed to the SharePoint server.
The <CustomAction> element in the feature XML below the C# code references this assembly via the ControlAssembly attribute and the compiled class is referenced by the ControlClass attribute.
If you're adapting the code in the post and creating your own project, ensure that your assembly and class names are correctly referenced in the feature XML file (through the ControlAssembly and ControlClass attributes).
Alternatively you can download the author's SharePoint Solution Pack which contains this feature and others.
you should create a new program to call the method

Resources