Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sweep not permitted in a FamilyDOcument

26 REPLIES 26
SOLVED
Reply
Message 1 of 27
dirk.neethling
673 Views, 26 Replies

Sweep not permitted in a FamilyDOcument

I am trying to create a FamilyDocument, which should contain a combination of swept profiles, depending on Input.

I am using an existing FamilyDocument (*.rfa) as template.

I have successfully tested the code for sweeping in the FamilyDocument, however when I remove some unwanted, unrelated passive Families from that document, I can no longer create the sweep.

So my quetion is: what conditions are necessary for me to be able to create a sweep?

Regards, Dirk

26 REPLIES 26
Message 2 of 27

OK, so I selected the following template:

 

C:\ProgramData\Autodesk\RVT 2016\Family Templates\German\M_Profil (Sweep).rft

 

Now I get this:

exc = {"Sketch plane creation is not allowed in this family.\r\nParameter name: document"}

 

Really frustrating. Which template do I need to use in order to be able to construct a sweep?

Message 3 of 27

Hi,

 

I think the template you mentioned is a 2D template, just for creating 2D profile families.

What about using "M_Allgemeines Modell.rft" for your 3D sweep ?

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 4 of 27

Yes, I tried "M_Skelettbau" and managed to create the sweep.

When I instantiate that Family using ist Symbol, I get this:

 

+  exc {"The symbol is not active.\r\nParameter name: symbol"} System.Exception {Autodesk.Revit.Exceptions.ArgumentException}

Message 5 of 27

Hi,

 

before using a FamilySymbol fs, you need to activate it:

 

if (!fs.IsActive)
{
    fs.Activate();
}

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 6 of 27
FAIR59
in reply to: dirk.neethling

the Profil templates are basically a plane for a profile-loop

 

Use   M_Allgemeines Modell.rft instead.

Message 7 of 27

Hello Revitalizer,

 

I have this question:

 

I managed to create the FamilyDocument, to load it, and to instantiate it.

THen I try to apply the same transformations to it, as the ones for the segmental tunnel elements. THese include flipping upright, turning around the central axis and translating.

It seems that all Rotation transformations are not possible.

I get the following Errors. What Features do I Need to give the Family so that it can be transfomrmed after being instantiated?

Regards, DIrk

_rotation_error1.png

Message 8 of 27

Hi Dirk,

 

I think this is caused by the restrictions of your family.

Depending on family category, there may be a boolean "Immer vertikal" respectively "Always vertical" property in the family editor.

 

This will prevent rotations around all but the Z axis.

 

You also could try to use a line-based family for your edges.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 9 of 27

OK, I found the check which stipulates that the element should always be vertical.

some additional questions:

 

- How can I programatically uncheck that?

- how can I convert this Family into an adaptive element?

- when I try and Close the FamilyDocument, after creation, the code cracks. How can I sequentially generate the FamilyDocument based on Inputs, then Close it, and then call it in a Project document?

 

Regards, Dirk

Message 10 of 27

I tried using "M_Allgemeines Modell (Linie)" as a template. Now there is a new issue. I get a Dimension which I have to somehow edit, not understanding what the thing wants from me.

Very frustrating working with FamilyDocuments, which is why I intuitively tried to avaoid them.

 

Which template will allow me to generate a 3D model and transform it freely?

Message 11 of 27

Hi,

 

 

 

- How can I programatically uncheck that?

That's a parameter of the Family.

 

- how can I convert this Family into an adaptive element?

Use a family template for adaptive components

 

- when I try and Close the FamilyDocument, after creation, the code cracks. How can I sequentially generate the FamilyDocument based on Inputs, then Close it, and then call it in a Project document?

I think it's a question of transactions.

LoadFamily needs to be performed outside a transaction.

Close the family document after loading it into the project file.

 

 

Have a nice weekend,

Revitalizer

 

 

 




Rudolf Honke
Software Developer
Mensch und Maschine





Message 12 of 27

Can die "AlwaysVertical" Parameter be modified after instantiation of the Family?

Message 13 of 27

Hi,

 

I don't know, just test it 🙂

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 14 of 27

I printed out the Parameters of the FamilyELement. It does not contain a flag for "AlwaysVertical":

 

parm: Fläche-> Area

parm: Aussparung Höhe-> Length

parm: Kommentare-> Text

parm: Familie-> Invalid

parm: Typ-> Invalid

parm: Typ-ID-> Invalid

parm: Ebene-> Invalid

parm: Volumen-> Volume

parm: Entwurfsoption-> Invalid

parm: Familienname-> Text

parm: Aussparung Länge-> Length

parm: Phase abgebrochen-> Invalid

parm: Versatz-> Length

parm: Aussparung Breite-> Length

parm: Phase erstellt-> Invalid

parm: Kennzeichen-> Text

parm: Aussparung Tiefe-> Length

parm: Basisbauteil-> Text

parm: Bild-> Image

parm: Typname-> Text

parm: Kategorie-> Invalid

parm: Familie und Typ-> Invalid

parm: Volumen-> Volume

parm: Verschieben mit umliegenden Elementen-> YesNo

parm: Kategorie-> Invalid

parm: Host-ID-> Invalid

 

Message 15 of 27

Hi,

 

the parameter is part of the family, not the element or the elementtype.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 16 of 27

You mean accessible through the Symbol obtained from

 

profileSymbol = Util.FindFamilySymbol(..  ?

Message 17 of 27

Hi,

 

yes, the FamilyInstance.Symbol.Family.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 18 of 27

here is the Output from that. Still no Parameter for "AlwaysVertical"

 

parm: Typname-> Text

parm: Baugruppenkennzeichen-> Text

parm: Kategorie-> Invalid

parm: Entwurfsoption-> Invalid

parm: Typenkommentare-> Text

parm: Typenbild-> Image

parm: Baugruppenbeschreibung-> Text

parm: Kategorie-> Invalid

parm: Familienname-> Text

parm: URL-> URL

parm: Bauelement-> Text

parm: Beschreibung-> Text

parm: Typenmarkierung-> Text

parm: OmniClass-Titel-> Text

parm: Kosten-> Currency

parm: Codename-> Text

parm: Hersteller-> Text

parm: OmniClass-Nummer-> Text

parm: Modell-> Text

 

Message 19 of 27

the crazy Thing is that I manually Switch off the flag AlwaysVertial in the FamilyEditor, save it, and then when I instantiate the Family, it's active again!

Message 20 of 27

Hello Revitalizer,

 

could you pls help me with the creation of the Family? I've tried out al the Generic classes,

 

M_Allgemeines Modell...rft

 

None of them enable me to create an instance which I can flip upright.

Which template should I use to create an instance which I can then transform w.r.t. all degrees of freedom (rotate about the 3 axes, translate in the 3 axes)?

Regards, Dirk

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community