Java Script

Java Script

roskirko
Collaborator Collaborator
1,163 Views
2 Replies
Message 1 of 3

Java Script

roskirko
Collaborator
Collaborator

I have listed a Java Script created based on Wes Newman's videos and associated data (thank you Eric Chappell). There is one variable that needs to have a library included / imported called alx (a reference error is the result from Infraworks). alx is part of the JsVec3D object to create a 3D coordinate. Any help? As a side question; To create the Well Known Text (wkt) statement, is it common practice to use the information found in the mentor2wkt.json file that comes with Infraworks?

Geographic Information Systems
Fanshawe College
0 Likes
Accepted solutions (1)
1,164 Views
2 Replies
Replies (2)
Message 2 of 3

wes_newman
Autodesk
Autodesk
Accepted solution

roskirko,

I've attached a new version of your script.

alx isn't what you are looking for, you want adsk.

However, that's not how I go about creating geometry.

I've commented out that section and replaced it with creating the point via json.

Also had to add a GUID, needed for 2016.3 forward.

feature was also misspelled a few times.

 

Regarding the wkt, what are you trying to accomplish?

Are you trying to use a CS that is not defined in InfraWorks 360?

 

-Wes

 

 

Message 3 of 3

roskirko
Collaborator
Collaborator
That worked great Wes; Thank you and Eric Chappell so much for your help. We have a databse of over 2000 deciduous tress on the campus (the confiers are in the works). I had run some simple script-like componenets on similar data files using built in Infraworks tools to import SDF files and then configure them but your solution is far faster and easier. All I need to do is work on the scaling, which is easy. With regards to the wkt; working from your examples I came across a refereence to a wkt shown as a long string thinking I needed a similar string fro the geographic zone I am working in; I bult a string from "scratch" with some success and then realized there were strings in the mentor2wkt.json file that I could perhaps use. Then, best of all, I realized the statement " var Wkt = app.GetBestFittingUTM84ProjectionWkt(model.Boundary.BBox2d, dbWkt); " took the wkt from the model I was working on which was perfect. I did do some reseach and found there are public libraries referring to Vec3D in the Git Hub. Perhaps your intial scripts using alx referred to an Object model similar to those on Git? Thanks once again.
Geographic Information Systems
Fanshawe College
0 Likes