Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
384 views
in Technique[技术] by (71.8m points)

Forge viewer deactivate BimWalk after activating programmatically

I have a viewer instance where I programmatically activate the BimWalk tool as soon as it is loaded.

viewer.toolController.activateTool('bimwalk');

The BimWalk tool activates, but it doesn't seem like the BimWalk extension is aware of this. If the user presses the first person button [to turn off BimWalk], the tool "activates" again. Subsequent presses on the button do not seem to do anything and then the viewer is locked and the user cannot pan around.

Is there an alternative way to activate BimWalk that stays consistent with the toolbar button?

question from:https://stackoverflow.com/questions/65927075/forge-viewer-deactivate-bimwalk-after-activating-programmatically

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You're right, the Autodesk.BimWalk extension itself is keeping the state of the tool as well. Because of that you'll want to activate the tool via the extension:

viewer.getExtension('Autodesk.BimWalk').activate()

Then, clicking the First Person button in the toolbar will deactivate the extension and tool properly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

Just Browsing Browsing

2.1m questions

2.1m answers

60 comments

56.8k users

...