DuctInsulationType

DuctInsulationType

jainn
Advocate Advocate
406 Views
3 Replies
Message 1 of 4

DuctInsulationType

jainn
Advocate
Advocate

Hi all,

 

How to create DuctInsulation Programatically, if document does not contains any default DuctInsulationType/DuctInsulation.

 

Below Method require DuctInsulationTypeID to create Insulation

 

DuctInsulation.Create(doc, ductType.Id, DuctInsulationType.Id, Thickness)

 

 

Document screen shot attach for reference

 

Capture.PNG

 

 

Please suggest.

 

Thanks

 

0 Likes
407 Views
3 Replies
Replies (3)
Message 2 of 4

Revitalizer
Advisor
Advisor

Hi,

 

you could use ElementTransformUtils.CopyElement to copy DuctInsulation or DuctInsulationType from another Revit file to your target project file.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 3 of 4

jainn
Advocate
Advocate

Hi,

 

Thanks for your Reply.

 

I tried your suggestion but get stuck in passing ElementID(elementToCopy).

 

ElementTransformUtils.CopyElement(Document document, ElementId elementToCopy, XYZ translation);

 

from where we can get these value.

 

As my document does not contains any default DuctInsulationType/DuctInsulation...

 

 

please suggest.

 

Thanks

0 Likes
Message 4 of 4

Revitalizer
Advisor
Advisor

Hi,

 

you have to try out which CopyElement overload fits, there are some samples just in this Revit API forum.

 

Also, you must use this method the right way:

Prepare a source file which contains your Element or Type.

If you have your Element, it has a Type automatically.

You need to populate this "template" file manually.

 

After this, copy this known (!) Element into your empty target project file.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes