Dear All,
I've managed to add custom properties to model items which are visible in the properties panel.
Is it also possible to add properties which are not visible to the end-user?
Or alternatively, is it possible to make properties read-only or locked or so?
I also want to store some generic custom properties in the document.
In AutoCAD I use the Named Objects Dictionary (NOD) for that.
Where to store such data in Navisworks?
Many Thanks & Best Regards
Wolfgang
Solved! Go to Solution.
Solved by xiaodong_liang. Go to Solution.
hi,
custom property cannot be set readonly/visible currently. you could pop out your own dialog of property. Thus you can control their visibility or readonly. Of course you have to ask the user not to open native property dialog, in case they do modification.
Navisworks API provides Document Database, which allows you to store information with the document. <Nw path>\api\net\examples\Basic Examples\CSharp\WPF is a demo. So by this mean, you could consider to display the properties temporarily, instead of adding them to the object.
Thank you Xiaodong Liang,
using the database works fine for me.
One note for others who go done the same route.
It's important that you dispose the database object in time, e.g. before you open or create a different document.
In my situation "Using" was the easiest way to achive that.
Here's a VB.Net code snippet:
Using database As DocumentDatabase = Autodesk.Navisworks.Api.Application.ActiveDocument.Database Using trans As NavisworksTransaction = database.BeginTransaction(DatabaseChangedAction.Edited) Dim cmd As NavisworksCommand = trans.Connection.CreateCommand() cmd.CommandText = " some SQL statement... " Try Dim affected As Integer = cmd.ExecuteNonQuery() trans.Commit() Catch ex As Exception trans.Rollback() End Try End Using End Using
Best Regards
Wolfgang
Hi Wolfgang,
much appreciate your trick to use Database API! It is also helpful to me 🙂