The development team reply:
The sample code is not correct.
The module PredefinedPointCloud.cs defines this method:
public void Free() { throw new NotImplementedException(); }
The fix is to just remove the "throw" line.
Cheers,
Jeremy
The development team reply:
The sample code is not correct.
The module PredefinedPointCloud.cs defines this method:
public void Free() { throw new NotImplementedException(); }
The fix is to just remove the "throw" line.
Cheers,
Jeremy
Do you have the right references loaded for the revit dll’s?
And these are set for copy local is false?
Im not sure what else it might be. I assume you can get external commands to run and work.
Any idea why the recreated elements (using FreeformElement.Create ) still show as "imported categories" in visibility graphics? Is there a way to avoid that?
Thanks
Dear Chris,
Thank you for your query.
I would suggest initially populating only the Tier 1, and then populating the other ones and their subnodes on demand when clicked by the user to open them.
If a specific node is never opened, there is no need to ever load its subnodes.
I am sure such techniques have already been implemented and published in the past.
In fact, I see a large number of solutions when searching the Internet for 'populate tree view on demand':
https://duckduckgo.com/?q=populate+tree+view+on+demand
I hope this helps.
Best regards,
Jeremy
I try to make a View3D which is the same as Shortcut keys "BX", like:
make a View3D (3D view) only contains the element which in a viewplan or just I choosed.
I tried to get the filter from the viewplan,and throuth the addfilter add the filterelement to the view3d new create by myself. but no use? It also show me the total project.
I think I may get a wrong way, and it could not support me choose element?
Any ideas?Could anyone tell me something about it?
Hi,
you need to set yourFreeFormElement.SubCategory.
You can add a new Category to your Family's FamilyCategory.SubCategories and assign this sub-Category to your FFE.
Revitalizer
You cannot modify anything in any file in the world under any OS whatsoever without opening it, afaik.
In the case of Revit, you cannot modify anything in the model without using the Revit API.
Furthermore, you cannot use the Revit API without first running a Revit user interface session.
If you are working with Revit files in Forge, your best bet for modifying them is to make use of the Forge Design Automation API for Revit:
https://forge.autodesk.com/en/docs/design-automation/v3/developers_guide/overview
Best regards,
Jeremy
Yes, you can extract an image from Revit using Visual Studio..
If you wish to work with Revit models using Visual Studio, you will be using the Revit API.
Here is all the necessary information on getting started with that:
https://thebuildingcoder.typepad.com/blog/about-the-author.html#2
If you are not making use of the Revit API and programming add-ins yourself, you should probably discuss this issue in one of the end user forums instead of here.
Please note that this discussion forum is dedicated to programming Revit using the Revit API.
Therefore, you cannot expect an answer to a question such as yours relating to installation, product usage or end user support issues here.
You should try one of the non-API Revit product support discussion forums instead for that:
https://forums.autodesk.com/t5/revit-api-forum/this-forum-is-for-revit-api-programming-questions-not-for/td-p/5607765
The people there are much better equipped to answer your question than us programming nerds.
I hope this clarifies.
Thank you for your cooperation and understanding.
Best regards,
Jeremy
Hello,
I am trying to store arbitrary result to ResultPackage.
When I am using 2 kinds of result with different units (DUT), then when I want to see applied results in view I get wrong units.
When I am using only 1 kind, units (and values) are shown correctly.
Of course I am using AddMeasurement() with particular units (DUT).
(the case with 2 kind of units are these units: "kilo newtons" and " kilo newtons meters")
(with selected kind I expect "kN m" instead of "kN")
(value that was stored in internal units was: -1872,9204 then I expect to see -174 kN)
Could you check that functionality? Or could you suggest if I could do something wrong?
Greetings Jaroslav.
Dear Jaroslav,
Thank you for your report.
Please provide a full minimal reproducible case demonstrating the problematic behaviour for the development team to take a look at:
https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Maybe they can provide some advice.
Thank you!
Cheers,
Jeremy
Please study the examples discussed in The Building Code topic group on creating and setting up a 3D view:
https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.37
They include demonstrations very similar to what you describe.
Best regards,
Jeremy
I use Revit 2019 and often get this problem when performing Union operation on two solids. Any alternatives to do union on two solids?
Thanks
I am doing that by using the code below:
public void AssignSubCategory(Document document, FreeFormElement element, String subCategoryName, String materialName) { Category cat = document.OwnerFamily.FamilyCategory; Category subCat = document.Settings.Categories.NewSubcategory(cat, subCategoryName); ElementId materialId = Material.Create(document, materialName); subCat.Material = document.GetElement(materialId) as Material; element.Subcategory = subCat; }
foreach (Solid solid in solids) { FreeFormElement nativeSolid = FreeFormElement.Create(doc, solid); AssignSubCategory(doc, nativeSolid, "subCategory "+ct.ToString(), "material "+ct.ToString()); ct += 1; }
The result model has the subcategories assigned correctly but for some reason also shows as "Imports in Families" in visibility graphics. (see screenshots attached).
Is there anyway to remove it from the "imports in Families"?
for the record, SpatialElementTag.Create() does not exist as a method in the 2019 API
I've tried every method I could think of to get the corners and transform them but unfortunately I haven't been able to get this working. I have to move on to another project so for now we'll just zoom into the element. I'll come back to work on this if I get free time and I'll post if I find a solution or explanation.
Thanks for your time and assistance.
I once implemented a sample that sets up a 3D view to exactly display a given 3D bounding box:
https://thebuildingcoder.typepad.com/blog/2009/12/crop-3d-view-to-room.html
Does that not fulfil your needs?
Cheers,
Jeremy
Thank you, but you already provided that link. I outlined the issues I was having with that method in message 3 of this forum post.
My best guess is that the method is perfectly sound, but there is something somewhere in my code that transforms some coordinate system in a way I wasn't expecting. I just don't have time to hunt down the issue right now, nor do you I would imagine.
Thanks again, I'll post an update if I figure out what's causing the issue.
I am trying to read the content of AppearanceAssetElement instances for a given material. I am following the instructions give in Boris Shafiro AU presentation about Schemas (https://www.autodesk.com/autodesk-university/class/New-API-Modify-Visual-Appearance-Materials-Revit-2017#video) and I have a few questions, I get the asset like this:
ElementId appearanceAssetId = material.AppearanceAssetId;
var appearanceAssetElem = document.GetElement(appearanceAssetId) as AppearanceAssetElement;
Asset asset = appearanceAssetElem.GetRenderingAsset();
First question. What's the appropriate way to get the schema of an asset? I can "guess" the schema by looking at asset.Name. That gives me something like "CeramicSchema" which I assume means this asset belongs to Autodesk.Revit.DB.Visual.Ceramic schema, but is there an enum or static field that would be more reliable?
So now I can get the properties like this:
AssetProperty certamicPattern = asset[Ceramic.CeramicPattern];
but that wouldn't capture all the asset properties, in fact, with this strategy I would lose more than half of the asset properties. Some of them are from the SchemaCommon, but then there are some that I am not quite sure which (if any) schema they belong to, these are a few names that I get when simply iterating over all the asset properties:
- AdvancedUIDefinition
- AssetLibID
- ExchangeGUID
- ImplementationGeneric
- ...
Should I simply Ignore everything that doesn't fit into SchemaCommon or Ceramic schema? Is there a schema somewhere that I am missing?
Thank you so much for the help!
Yep, busy we are all.
Still, out of interest and the kindness of my heart, if you provide a minimal sample model including a handful of elements and a 3D view which needs cropping to those elements, I can try running the existing CmdCropToRoom on that and see whether it works out of the box or anything needs adapting:
https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Cheers,
Jeremy