添加您自己的功能
Last updated
Last updated
<p>Cylinder: Create a cylinder at the origin.</p>
<div>
<input id="Radius" type=number value=2 />
<label>Radius</label>
</div>
<div>
<input id="CHeight" type=number value =0.5 />
<label>Height</label>
</div>
<input id="CreateCylinderBtn" type=button value="Create Cylinder" />// Create cylinder
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);
}
// Execute function when 'create cylinder' button is clicked
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);
});