Revit API

Posts: 3
Registered: ‎10-01-2012
Message 1 of 3 (186 Views)

adaptive component internal error

186 Views, 2 Replies
10-01-2012 11:47 AM

Hi All, I'm writing an plugin to be executed as an externalcommand, and I'm running into a problem, below are the lines of code.


Dim fam As FamilySymbol = M_Doc.GetElement(obj.Id)

Dim comp As FamilyInstance = AdaptiveComponentInstanceUtils.CreateAdaptiveComponentInstance(M_Doc, fam)


m_doc is a valid current document is a valid id for a familysymbol

when the code reaches the second line "dim comp..." it throws an exception "an internal error has occured"


Any idea as to why it would be happening? Any input would be greately appreciated. 


Distinguished Contributor
Posts: 148
Registered: ‎04-01-2011
Message 2 of 3 (178 Views)

Re: adaptive component internal error

10-03-2012 02:42 AM in reply to: Crashnorun

Sorry that I don't know VB but I find starnge that if you write...

Dim fam As FamilySymbol = M_Doc.GetElement(obj.Id)

Why can't you directly cast obj to fam as FamilySymbol because now you are getting the element from document which actually you already have. Or is there some kind of logical error in your code?

ADN Support Specialist
Posts: 325
Registered: ‎03-05-2010
Message 3 of 3 (125 Views)

Re: adaptive component internal error

10-25-2012 02:57 AM in reply to: Crashnorun


With only these 2 lines, it is hard to tell what's wrong.

From the code itself, it is correct.


Maybe the famiy symbol you passed in is not eligible to create the adaptive component.

Joe Ye
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community

Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Revit