This is NAyche's Typepad Profile.
Join Typepad and start following NAyche's activity
NAyche
Recent Activity
Thanks Jeremy,
I was able to complete my extesnion without having to use a Label. But to answer your question, the dimension label is a bit different. In the user interface, any label can be assigned to the dimension as long it has one parameter. But, labels may have an infinite number of parameters.
Programmatically, API is able to assign the parameter to the dimension directly as you saw in dim.Label = familyParam, but really no actual lable is created.
What I was trying to do is to create a label that has n-number of parameters. I was going to associate the instances of that family with a Note Block. What I found is that you can create the family, add the parameters to it and then load it into the project. It will do the job without nothing physical is been created in the project.
I hope this helps in explaining the difference.
Regards,
Nadim
The Revit Family API
Here is a rather lengthy and rich post to start off the week, describing the new family API introduced in Revit 2010 and including both an overview and in-depth information. These are the main topics covered: Creating a Family through the User Interface. Creating a Family Programmatically. Fami...
Thanks Jeremy.
Yes, you can do that in the user interface, inside a family editor. The label might be the most common element used in the Annotation Families.
Regards,
Nadim
The Revit Family API
Here is a rather lengthy and rich post to start off the week, describing the new family API introduced in Revit 2010 and including both an overview and in-depth information. These are the main topics covered: Creating a Family through the User Interface. Creating a Family Programmatically. Fami...
Jeremy,
Another question.
I am trying to create an instance of a Generic Annotation Family using
FamilyInstance instance = xDoc.Create.NewFamilyInstance(new Autodesk.Revit.Geometry.XYZ(0, Y, 0), symbol, Autodesk.Revit.Structural.Enums.StructuralType.NonStructural);
However, "instance" return null always.
Any idea why?
Regards,
Nadim
The Revit Family API
Here is a rather lengthy and rich post to start off the week, describing the new family API introduced in Revit 2010 and including both an overview and in-depth information. These are the main topics covered: Creating a Family through the User Interface. Creating a Family Programmatically. Fami...
Jeremy,
I hope everything is going well for you.
I am trying to use the FamilyItemFactory to create a label inside the family document. I can see all kinds of creation functions like NewDimension, NewSweep, NewTextNote,...
but I can't find any function to do NewLabel()
How do we go about that?
Regards,
Nadim
The Revit Family API
Here is a rather lengthy and rich post to start off the week, describing the new family API introduced in Revit 2010 and including both an overview and in-depth information. These are the main topics covered: Creating a Family through the User Interface. Creating a Family Programmatically. Fami...
Jeremy,
When trying to view the types in the steel section family
W-Wide Flange.rfa, the FamilyManager.Types will return only the types within the family.rfa file (in this case it is one type only).
All other types are actually referenced in a text file W-Wide Flange.txt in the same folder.
How do we retreive these types and list them?
Regards,
Nadim
Revit API Cases 1
Here are the summaries of some of the Revit API ADN cases handled by me and my colleagues Joe Ye and Saikat Bhattacharya in the past few days: Set the display colour of a line. Split walls and lines, or ducts and pipes. Change colour of a family instance. Export family symbols from a project an...
Jeremy,
Never mind my previous post, apparently I had referenced the wrong RevitAPI.dll file.
Now I have IsFamilyDocument property.
Sorry about that.
Regards,
Nadim
Revit API Cases 1
Here are the summaries of some of the Revit API ADN cases handled by me and my colleagues Joe Ye and Saikat Bhattacharya in the past few days: Set the display colour of a line. Split walls and lines, or ducts and pipes. Change colour of a family instance. Export family symbols from a project an...
Jeremy,
I don't get the IsFamilyDocument property with the doc object.
This is what I am trying to do:
bool isFam = doc.IsFamilyDocument;
but when I type doc.IsFamilyDocument I get the following error. Any idea why?
Regards,
Nadim
Error 1 'Autodesk.Revit.Document' does not contain a definition for 'IsFamilyDocument' and no extension method 'IsFamilyDocument' accepting a first argument of type 'Autodesk.Revit.Document' could be found (are you missing a using directive or an assembly reference?) C:\API Manual\API Manual\Chapter10.cs 31 29 API Manual
Revit API Cases 1
Here are the summaries of some of the Revit API ADN cases handled by me and my colleagues Joe Ye and Saikat Bhattacharya in the past few days: Set the display colour of a line. Split walls and lines, or ducts and pipes. Change colour of a family instance. Export family symbols from a project an...
Thanks Jeremy,
Just like I benefit from this unique blog, I wanted to contribute to it too.
Best regards,
Nadim
Selection Questions
A whole bunch of questions on selection of elements and points came in during the last day or two. Here are a few of them: How can I force the user to select an element when my external command begins? Answer... How can I invoke an existing Revit command when my external command begins? Answe...
Feedback on RevitAPI 2010:
After I finished fixing my external application, I have the following feedback on two issues with RevitAPI 2010.
1. The selection commands do not seem to work properly.
Sometimes the elements are not highlighted, I worked around that by adding elementSet.Hide() and then elementSet.Unhide() methods to get elements highlighted always.
Contextual menu is showing now after installing the Revit Web Updates.
Access to the Element Properties of selected element is NOT possible (unline Revit 2009), no work around in the code. At the user interface, I have to move the selected elements a zero distance and I would get the access to the properties.
2. Print Project Sheets
no matter what you do, ptManager.SubmitPrint() will always print the sheets in the order they are created. I guess that Revit sorts ViewSets internally by the element id. Don't waste your time trying to implement a custom IComparer to compare ViewSheets by their names, it will not do it.
The work around is to save the names of the views in a Generic List and then sort it. Then send sheets one at the time in the the sequence of the sorted List.
Regards,
Nadim
Selection Questions
A whole bunch of questions on selection of elements and points came in during the last day or two. Here are a few of them: How can I force the user to select an element when my external command begins? Answer... How can I invoke an existing Revit command when my external command begins? Answe...
NAyche is now following Jeremy Tammik
Dec 20, 2009
TypePad HTML Email
Thanks Jeremy,
I guess Ill wait until these features are added to the API.
Regards,
Nadim
Custom Ribbon Tab
I am still on tour presenting at the Western European DevDays conferences, and with no time for blogging or responding to comments. In fact, I have almost no time for anything at all except presenting, meeting and discussing with participants during the day, and getting from one city to the next...
Thanks Jeremy,
Is there any support for having a default button in the PullDownButton?
I mean by that when hte pulldownbutton looks like two parts, the upper partclicks on of the pushbuttons in the list, and the bottom part gives the menu of pushbuttons added to this pulldownbutton.
Example: Revit UI has alot of examples on this, like, Wall pulldownbutton (Home tab), ElementProperties pulldownbutton ( the default is the Instance Properties)
Regards,
Nadim,
Custom Ribbon Tab
I am still on tour presenting at the Western European DevDays conferences, and with no time for blogging or responding to comments. In fact, I have almost no time for anything at all except presenting, meeting and discussing with participants during the day, and getting from one city to the next...
Jeremy,
Good luck with your trip.
If the PushButton text is long, for example "My External Command" (hypothetical example), how can I place it on two lines just like it is shown in the "Structural Settings" Command in the "Manage" tab.
Regards,
Nadim
Custom Ribbon Tab
I am still on tour presenting at the Western European DevDays conferences, and with no time for blogging or responding to comments. In fact, I have almost no time for anything at all except presenting, meeting and discussing with participants during the day, and getting from one city to the next...
Thank Jeremy,
I am very humbled by your statement. I will never know more than you do. Your blog was a savior for me.
I am just a structural engineer, and I am just trying to use my time in something meaningful as we don't have much engineering work to do :) (The current economy story)
Please don't treat me as a professional programmer because I am not. Until recently, I only knew VB6. I am new to the .NET, and thanks to you, I shifted to using C# because your examples are in C#, and I love it.
Please keep the good work as amateurs like me need your help.
Regards,
Nadim
Selection Questions
A whole bunch of questions on selection of elements and points came in during the last day or two. Here are a few of them: How can I force the user to select an element when my external command begins? Answer... How can I invoke an existing Revit command when my external command begins? Answe...
Jeremy,
After enough research and testing, I found that the selection example in the manual is actually having the same problem my code has. Which is: it selects the elements and it provides the contextual menu, but it would not give access to element properties like it does with the UI.
If the code in the Revit Manual is not working, then I gave up.
Regards,
Nadim
Selection Questions
A whole bunch of questions on selection of elements and points came in during the last day or two. Here are a few of them: How can I force the user to select an element when my external command begins? Answer... How can I invoke an existing Revit command when my external command begins? Answe...
Jeremy,
I found the solution, at least I fixed my problem.
What I had to do is to SaveAs() the viewSheetSetting as follows:
ViewSheetSetting viewSheetSetting = ptManager.ViewSheetSetting;
ViewSheetSet viewsToPrint = viewSheetSetting.CurrentViewSheetSet;
viewSheetSetting.SaveAs("No one will guess this name");
/*
here you add the code and place all views in a ViewSet
and populate it back to ViewSheetSettting.CurrentViewSheetSet.Views
The next step is the key step
*/
viewSheetSetting.CurrentViewSheetSet = viewsToPrint;
Is there any place where I can find some information regarding how revit process plotting. My biggest confusion is when am I using the in-session and when I am not.
I hope this helps.
Nadim
The Revit MEP 2010 API
We already presented an analysis of the MEP connectors in Revit 2010, but a general introduction to the MEP-specific API is still missing. Or was, until today. Question: What can I do with the Revit MEP API? What's new in Revit MEP 2010? Are there any additions or enhancements specifically for ...
Jeremy,
Here are the requirments to join ADN:
http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=723350
we don't fullfil the following requirment for sure because we are a structural engineering company
"You have at least one full-time professional software developer on staff"
Even if we do, we might use it for a week and then get busy with engineering work and never use it again.
I hope you bear with us even if we bug you with the same issue again, because sometimes I will find something new that your input would be valuable.
Examples:
After installign Web Update 2,
- my selection commands start to give me the contextual menu but not the Element Properties (half is solved).
- in printing, the tmpViewSet is not populated back to the ptManager...CurrentViewSet.Views but the printSetup and printParameters are not
it is abvious that this problem was caused by changed on Autodesk side (it works well with 2009), yet they provide zero documenations on these changes and its effect on our existing code.
Regards,
Nadim
Selection Questions
A whole bunch of questions on selection of elements and points came in during the last day or two. Here are a few of them: How can I force the user to select an element when my external command begins? Answer... How can I invoke an existing Revit command when my external command begins? Answe...
Thanks anyway, you're doing a good job.
To answer your question, no I am not doing this professionaly, because I am a Structural Engineer and not a programmer. I just have some overhead time and I spend on the API.
I wish we can join ADN; however, we do not meet the requirments to joint.
The reason I posted back to you is that It was obvious the issues I am having are because of bugs they introduced to Revit 2010. Just by installing Web Update 2 fixed half of my problems in all the commands I created. It would be great to know if I have to wait for another update for my code to work again or try to figure it out my self?
Thanks anyway.
Regards,
Nadim
Selection Questions
A whole bunch of questions on selection of elements and points came in during the last day or two. Here are a few of them: How can I force the user to select an element when my external command begins? Answer... How can I invoke an existing Revit command when my external command begins? Answe...
Jeremy,
Sorry for using that silly please, it is just that I spend all this time in the past few weeks writing code for Selection and Printing tools, suffering was with me all along until with your help and experimenting I got the plotting and selection to work fine. The changes they made to the API took me back to where I started. Nothing is working on API 2010. you can understand my frustration.
back to this problem:
I have a code that is the same as yours. I also have the last statement
doc.Selection.Elements = selElements;
if you degug it, the Selection.Elements is not empty. However, on the screen, nothing is selected.
Here is what I found today: if I use the pan command and move the building, it colors the elements to be selected with Red (my selection color) but still I can get either of the following:
1. No Contextual menu appears, i.e. I can't do anything to the selected elements (makes it useless)
2. I don't get the Element Properties command, as if nothing is selected.
Is there any extra code we have to write for Revit 2010 to give us the complete selection expectations
Thanks again,
Nadim
Selection Questions
A whole bunch of questions on selection of elements and points came in during the last day or two. Here are a few of them: How can I force the user to select an element when my external command begins? Answer... How can I invoke an existing Revit command when my external command begins? Answe...
Thanks to the changes made to the PrintManager in Revit API 2010, I am back to the same problem. I have to spend alot of time on it again, and I really feel my blood pressure is going up because of this issue.
I need to upgrade my printing application to Revit 2010; however, the same problem is happening again. The views that will be printed and added to a ViewSet named tmpViewSet are not been populated to the ...CurrentViewSheetSet.Views even if write it as follows:
ptManager.ViewSheetSetting.CurrentViewSheetSet.View = tmpViewSet;
Whatever change the API developers did, it prevents this solution from working again.
obvoisly, you can not say ...CurrentViewSheetSet.Views.Insert(vw) because the Views collection is a read only.
Pleeeeeeeeeeeeeeeeeease help or ask any insider how to populate the views to be printed to the ptManager.....Views property.
Thanks in advance,
Nadim
The Revit MEP 2010 API
We already presented an analysis of the MEP connectors in Revit 2010, but a general introduction to the MEP-specific API is still missing. Or was, until today. Question: What can I do with the Revit MEP API? What's new in Revit MEP 2010? Are there any additions or enhancements specifically for ...
Jeremy,
The following selection method works fine with Revit 2009 but not Revit 2010. Any idea why?
SelElementSet selElements = doc.Selection.Elements;
/*
- code here for adding elements by whatever filter to the selElements, for example columns in a specific level or a view
- debuging shows that selElements set has about 30 columns
- Yet it does not actually select anything even if you do the following
*/
doc.Selection.Elements = selElements;
Pleeeeeeeeeeeeeeeeease help.
Regards,
Nadim
Selection Questions
A whole bunch of questions on selection of elements and points came in during the last day or two. Here are a few of them: How can I force the user to select an element when my external command begins? Answer... How can I invoke an existing Revit command when my external command begins? Answe...
Jeremy,
I have the same question. There is a horizontal separator button in a PullDownButton. See Home tab, Component pulldownbutton or Model Group pulldownbutton.
How can we do this?
Regards,
Nadim
Revit 2010 Ribbon API
I am currently sitting in Stockholm, preparing a visit to a Revit developer here and enjoying the wonderful Swedish nature in May. On Saturday I cut a couple of cubic meters of beautiful birch wood for heating with my friend Alexander in Huddinge, and on Sunday we went together with another clas...
I found the problem.
Basically, it is caused by the PrintManager.PrintToFileName property.
I did work around it; however, I think the problem is in the Revit UI setup for printing electronic files.
Example: when you print a pdf, the pdf printer will give you the choice to pick a folder to save at. It will overrite it if you choose to.
With that said, I don't undertand why the Revit asks you to put a path for the file before. It is redudant. It will be overriden by the pdf printer anyway. and it is causing this issue. IF you can pass it on to Revit Developers would be great.
I hope this help.
Thanks.
Revit Install Path and Product GUIDs
Things were a bit hectic with many cases toward the end of last week, so less posts. By chance and luck, I was able to spontaneously join a ski tour on Sunday. The danger of avalanches is currently pretty high in most of Switzerland, and the weather was bad with lots of snow as well, so we evade...
Jeremy,
I did a publish command for my company a few weeks ago.
The following bug showed up after the command is been in use on other machines.
It basically happens with PDF plots, here is exception message and stacktrace
[
The files already exist!
at Autodesk.Revit.PrintManager.SubmitPrint()
at PJF.Revit.Plotting.PlotUtilities.PlotExecute(Document& xDoc, String& xPrinterName, PaperSize& xPaperSize, ZoomType& xZoomType, Int32& xZoom, PageOrientationType& xPageOrientation) in C:\PJF Revit 2009\Plotting\PlotUtilities.cs:line 168
at PJF.Revit.Plotting.Plot.Execute(ExternalCommandData commandData, String& message, ElementSet elements) in C:\PJF Revit 2009\Plotting\PlotForm.cs:line 147
]
basically, it happens at the final SubmitPrint() method.
And it happens only when the file is already plotted before.
Oddly enough, this happens only if a copy of the pdf file is already saved on the My Document. if I go to My Documents and delete the pdf file, it works fine again.
Have you come across this? Any idea why this SubmitPrint() method is confilicting with an existing pdf plot in the My Documents?
your help and guidance are highly appreciated.
Regards,
Nadim
Revit Install Path and Product GUIDs
Things were a bit hectic with many cases toward the end of last week, so less posts. By chance and luck, I was able to spontaneously join a ski tour on Sunday. The danger of avalanches is currently pretty high in most of Switzerland, and the weather was bad with lots of snow as well, so we evade...
That true.
I was still trying to restrain myself from messing up with the RevitAPI classes :)
Besides, extension methods are new methods with new names.
it is not a big deal, but it would be good if they add this one line of code to their base Element class :)
regards,
Nadim
UniqueId, DWF and IFC GUID
One frequent question from developers has been on how to correlate the GUIDs or globally unique identifiers used when exporting models to DWF and IFC from Revit with the element ids and unique ids used internally in the Revit model. GUID and UniqueId A GUID is a 16-byte, i.e. 128 bit number. I...
More...
Subscribe to NAyche’s Recent Activity