-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.js
37 lines (27 loc) · 1.11 KB
/
plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const createBlock = async (w,l,h) => {
const pt1 = await WSM.Geom.Point3d(0,0,0);
const pt2 = await WSM.Geom.Point3d(w,l,h);
const histID = await FormIt.GroupEdit.GetEditingHistoryID();
console.log(histID, pt1, pt2)
const test = await WSM.APICreateBlock(histID, pt1, pt2);
}
document.getElementById("CreateBlockBtn").addEventListener("click", () => {
const w = Number(document.getElementById("Width").value);
const h = Number(document.getElementById("Height").value);
const l = Number(document.getElementById("Length").value);
createBlock(w,l,h);
});
const createCylinder = async (r,h) =>
{
const posCenter = await WSM.Geom.Point3d(0,0,0);
const histID = await FormIt.GroupEdit.GetEditingHistoryID();
console.log(histID,posCenter,r,h);
const cyl = await WSM.APICreateCylinder(histID,posCenter,r,h);
}
document.getElementById("CreateCylinderBtn").addEventListener("click", ()=>
{
console.log('create cylinder clicked')
const r = Number(document.getElementById("Radius").value);
const h = Number(document.getElementById("CHeight").value);
createCylinder(r,h);
});