there are several ways to modify the properties panel,
var propertyPanel = _viewer.getPropertyPanel(true)
propertyPanel.setTitle('My Panel')
propertyPanel.addProperty('test', 'john', 'new cat', null)
propertyPanel.setVisible(true)
AutodeskNamespace('Viewing.ClassroomTrainning')
Viewing.ClassroomTrainning.AdnPropertyPanel = function (viewer) {
var _panel = this
var _viewer = viewer
var _selectedNodeId = ''
Autodesk.Viewing.Extensions.ViewerPropertyPanel.call(
_panel,
_viewer)
_panel.setNodeProperties = function (nodeId) {
Autodesk.Viewing.Extensions.ViewerPropertyPanel.prototype.setNodeProperties.call(
_panel,
nodeId)
_selectedNodeId = nodeId
}
_panel.setProperties = function (properties) {
Autodesk.Viewing.Extensions.ViewerPropertyPanel.prototype.setProperties.call(
_panel, properties);
var insTree = _viewer.model.getInstanceTree();
var nodeName = insTree.getNodeName(_selectedNodeId);
$.ajax({
url: '/db/price/'+nodeName,
type: 'GET',
success: function (data) {
console.log('successfull get price: ' + data)
_panel.addProperty(
'Node Price', // property name
data, // property value
'Database Information') // group name
}
})
}
}
Viewing.ClassroomTrainning.AdnPropertyPanel.prototype =
Object.create(
Autodesk.Viewing.Extensions.ViewerPropertyPanel.prototype)
Viewing.ClassroomTrainning.AdnPropertyPanel.prototype.constructor =
Viewing.ClassroomTrainning.AdnPropertyPanel
then, set the reloaded property panel to the current property panel, and modify the click event of the model structure to use the custom property panel:
Viewing.ClassroomTrainning.Extension.prototype.onGeometryLoaded = function () {
var panel = new Viewing.ClassroomTrainning.AdnPropertyPanel(_viewer)
_viewer.setPropertyPanel(panel)
// Add onClick event for Model Structure Panel
var structruePanel = _viewer.modelstructure
structruePanel.onClick = _self.onModelStructureClick
}
Viewing.ClassroomTrainning.Extension.prototype.onModelStructureClick = function (node, e) {
var propertyPanel = _viewer.getPropertyPanel(true)
if (propertyPanel && propertyPanel.isVisible()) {
propertyPanel.setNodeProperties(node)
}
}
for more information, please see https://github.com/JohnOnSoft.
.Previous: How can Bootstrap fileinput only preview images?
Next: [solved] how to use webpack to package js files into json files
load the model, the container turns black. at first thought it was my program s problem. But try it with the code of the example, too. is there something wrong with the server? the following is the source code of the example. It used to be possible....
how does autodesk forge get accessToken (JS or c-sharp automatically? In other words, how to automatically obtain the accesstoken below? ...
when using three.js, use raycaster to select objects. If there is div occlusion on the upper layer of the canvas, the mouse can still select the model in the canvas. If you want to select a model that is not available when there is div occlusion, how to ...
how do I remove some controls from the default toolbar in forge viewer, such as removing the controls in the red line in the screenshot? The methods I ve tried before are var group = viewer.toolbar.getControl ( navTools ); group.removeControl ( to...
after using viewer = new Autodesk.Viewing.Viewer3D (myViewerDiv, config3d), there are no tools on the entire interface, not even viewcube. Now I want to make a layout on this quick interface, such as adding some div, and the location is on the right, so...
1. How to get the currently selected artifact or the currently selected build set 2 3 ...
as far as I understand it, this new first view tool is a roaming tool with gravity. The default view of this tool is a little high. How to set this height? ...
when I roam with the new version of bimwork, as shown in the following figure I manually downloaded version 4.2 offline viewer, and all the JS related to version 4.2 including extensions. I hope God will reply, is it because I downloaded less stuff?...
the default rendering style of viewer and the rendering style in the settings are not very suitable for my needs. Is there any way to set the default rendering effect of viewer? For example, the following two pictures, the first is the default rendering ...
after my bucket is found on my model, the model will disappear after a while. How should I modify it so that it can be permanently stored in bucket? bucket ...
how to allow the camera to rotate only left and right during mouse operation, and forbid the camera to rotate up and down. ...
the doors in the model are like the right side, and there are two modes of opening and closing at the same time. through the setting of the revit property, you can display open (left door), close and simultaneously open (right door) , but after importe...
because of the requirements of the project, I just came into contact with forge. currently I have converted the rvt model to svf format and exported it offline to my local, then load the model through viewer.loadModel ( static model xxx Resource _ ...
JS implementation shortens the distance (AUtoDesk-forge) ...
Autodesk-forge model slightly how to load this model in IE browsers? at present, only advanced browsers such as Crome Google are supported ...
as mentioned above, the requirement requires obtaining 4D information, that is, reading the plan progress in the model. We don t know much about this. At present, we only know that the plan information created by the model designer through MS project i...
I have multiple models, and after converting the models through the forge server, I download these converted svf file formats respectively. So how do I aggregate these models locally? ...
Today, I encountered an IE browser compatibility problem when I was working on a project, saying that I need an iewebGl plug-in < _ ...
as shown in the figure, the rotation and movement of the model will be displayed. How can I hide it? ...
how can I call the measurement tool in Autodesk.Viewing.Private.GuiViewer3D through the Autodesk.Viewing.Viewer3D object of Autodesk-forge? ...