Autodesk Revit API
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Shared Parameter change cause exception from a running form
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I am trying to change an instance shared parameter value from a .net win form which has been shown by running an external command.
after changing the value of parameter of an element, the new value will be shown in the property panel, but when saving the model, the property has been restored to the previous value.
I tried Transaction but get following error:
Autodesk.Revit.Exceptions.InternalException was unhandled
Message=An unexpected managed exception was thrown by internal Revit code.
Source=RevitAPI
StackTrace:
at Autodesk.Revit.DB.Transaction.Commit()
...
Any Idea?
Re: Shared Parameter change cause exception from a running form
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
This a little bit silly thing to ask, but still...are you sure, that you have started the transaction before parameter change & commit?
Other thing about losing the changed value. Are you sure that you return Result:
ucceeded when leaving the external command?
Re: Shared Parameter change cause exception from a running form
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Yes, Pretty Sure,
and the funny thing is, if I don't use transaction, the value will be changed but won't be saved by saving the model.!!
Re: Shared Parameter change cause exception from a running form
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I"m having a similar problem with the adaptive generic component. Has there been a solution or reason as to why / what that error mean?
Thanks,
Re: Shared Parameter change cause exception from a running form
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Crashnorun,
If you are asking about the meaning of this message:
>>>
Autodesk.Revit.Exceptions.InternalException was unhandled
Message=An unexpected managed exception was thrown by internal Revit code.
<<<
This is a general message when an error thrown by somewhere in the code weren't caught by the program.
Try including Try/Catch statement, and try to catch an error. If yo look at SDK samples, you will see many examples which shows you how to use Try/Catch.
If you are still having a problem, I advice you to post a separate question with a ready-to-build, minimum, reproduciable sample project to demonstrates your issue.
Mikako Harada
Developer Technical Services
Autodesk Developer Network
Re: Shared Parameter change cause exception from a running form
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I just saw you have already posted. Thank you very much.
Mikako Harada
Developer Technical Services
Autodesk Developer Network
