Quantcast
Channel: All Revit API Forum posts
Viewing all 67020 articles
Browse latest View live

Re: SDK Sample PointCloudEngine crash for Revit 2018 and 2019

$
0
0

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

 


Re: External Command Initialization issue

$
0
0

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.

Re: Explode SAT/DWG after import

$
0
0

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

Re: WPF - Window With TreeView - Slow Load With Virtualization

$
0
0

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

 

How could I make a View3D based by a ViewPlan through the Revit api?

$
0
0

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?

 

Re: Explode SAT/DWG after import

$
0
0

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

 

 

Re: How to get and modify element parameter without opening the revit file

$
0
0

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

 

Re: Extraer imagen de revit a excel através de visual studio


Re: BIM Interoperability Tool: Classification Manager

$
0
0

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

  

Structural analysis toolkit, application results to view showing wrong units

$
0
0

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).

wrong-units.PNG

(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.

Re: Structural analysis toolkit, application results to view showing wrong units

Re: How could I make a View3D based by a ViewPlan through the Revit api?

Re: Boolean Operation Fail

$
0
0

 

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

Re: Explode SAT/DWG after import

$
0
0

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"?

 

 

 

Re: doc.Create.NewTag

$
0
0

for the record, SpatialElementTag.Create() does not exist as a method in the 2019 API


Re: Show Element Relative to Model in View3D

$
0
0

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.

Re: Show Element Relative to Model in View3D

Re: Show Element Relative to Model in View3D

$
0
0

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. 

How to get a material's AssetProperties by Asset schema

$
0
0

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!

 

 

Re: Show Element Relative to Model in View3D

$
0
0

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

 

Viewing all 67020 articles
Browse latest View live


Latest Images