Community
I use the code below to creat takeofffiting between connector and pipe:
foreach (var v in toConnects) { ElementId tempTypeId = Util.GetPipeType(doc, v.ConType);//PipetypeId ElementId zhiTypeId = v.Connector.Owner.GetTypeId(); Pipe ppp = v.Connector.Owner as Pipe; v.Connector.Owner.ChangeTypeId(tempTypeId); zhu.ChangeTypeId(tempTypeId); FamilyInstance takeofff = doc.Create.NewTakeoffFitting(v.Connector, zhu); sb_aaa.Append(takeofff.Id.ToString() + ","); string s = takeofff.Symbol.Family.Name; sb2.Append(takeofff.Id.ToString() + ":" + s+"\n"); doc.Regenerate(); ppp.ChangeTypeId(zhiTypeId); }
the variable "sb_aaa" is used to record the elementid I created.
The firist line of the picture below is record of elementid I created; I use the "select by ID" command in Revit and paste the first line ,it shows me like the second picture. It seems tha all the element I created is deleted by Revit .
How can I avoid this?
As the instances get created, the fault should be in the next ( bit of ) code. So without extra information I can only make some (trivial) guesses.
Can't find what you're looking for? Ask the community or share your knowledge.