0

I am use to develop one web app using Forge API. It's working well and good. At the same time am using design automation in forge. I can able to create Package and it's working fine.

I will process the dwg file using forge api preparing to viewer. I can able to view dwg in browser.

My issue is I have viewer click event the event click populate the element id. However, my package I can get only the object id. element id and object id totally different.

What is the conman id each object client and server side.

Summary: when user click the object in viewer I want to capture id and store my local database. and using package I need to process the user clicked object.

Example: when user click the drawing number in viewer. From the next time I want change the drawing number dynamically using call package from C# code.

halfer
  • 19,824
  • 17
  • 99
  • 186
RAGU
  • 1
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Feb 10 '18 at 12:01
  • 1
    Moderators - Please would you remove the hold on this question. In the context of the autodesk* tags used here, the question is perfectly understandable. (The only inappropriate tag is the generic 'forge' tag, as the question is about 'autodesk-forge', but that mistake is understandable). Thanks. – Stephen Preston Feb 12 '18 at 23:19
  • @StephenPreston happened to come across this while reviewing. Your comment makes it clear that it should be re-opened (and so it has) – ItamarG3 Feb 14 '18 at 16:44

1 Answers1

2

For an RVT file, one easy way to handle this is to extract the Forge externalId from the Forge object properties. That is equal to the Revit element UniqueId property. The RvtMetaProp Revit add-in makes use of this.

Oh, now I just found a better, more complete and succinct explanation of Unique IDs for Forge Viewer Elements:

The Viewer gives access to three types of IDs when dealing with Revit files:

  • dbId: this is viewer specific and used to manipulate elements within the viewer, such as for the .getProperties() method.
  • Revit ElementID: exposed as part of the Name property in the viewer. When you select something, the Property panel title is in the form of 'Name [12345]'. You can parse this name string and extract the element id.
  • Revit UniqueID: exposed as the externalId property in the .getProperty() response.
Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • This operation abuot DWG file am not using RVT . I Upload the DWG file using Forge API and translate to SVF for preparing viewer and i can able to view in browser now. What is the conman id each object client and server side for DWG – RAGU Feb 10 '18 at 12:36
  • Please take a look at this example: https://github.com/Autodesk-Forge/design.automation-custom-data-viewer. The common ID that is understood on the server and the client is called a "handle". – Albert Szilvasy Feb 10 '18 at 16:18
  • Elaborating on Albert's response - an ObjectId in AutoCAD is unique to a session and is not persisted. The unique identifier within a DWG file is the object handle. In addition to the sample that Albert quotes, please review this blog post - https://forge.autodesk.com/cloud_and_mobile/2016/10/entity-handle-from-dwg-file-in-viewer.html. – Stephen Preston Feb 12 '18 at 23:15