Hi.
I am trying to create multiple Surface Extensions using a Loop, after selecting multiple composite curves.
I am using Vbscript - HTM.
The code works fine if i only select one composite curve.
If i select more than one composite curve, it doesn´t work.
Here is the code:
<HTML>
<HEAD>
<script language="VBscript">
<!--
// Connect to PowerSHAPE
set PowerSHAPE = Window.external
// the routine called when the button is clicked..
Sub Apply_click()
//get the number of items in the current selection
num_items = PowerSHAPE.Evaluate( "SELECTION.NUMBER" )
IF (num_items = 0) then
MsgBox ("Nothing is selected")
Else
Dim i
i = 0
// loop through all the selection
For i = 0 to num_items - 1
// get the name
cName = PowerSHAPE.Evaluate("SELECTION.OBJECT[" & i & "].NAME")
PowerSHAPE.Exec("ADD COMPCURVE '" & cName & "'")
PowerSHAPE.Exec("CREATE SURFACE EXTENSION")
PowerSHAPE.Exec("ALONG SURFACE_INTERNALS")
PowerSHAPE.Exec("DISTANCE 4")
PowerSHAPE.Exec("APPLY")
PowerSHAPE.Exec("CANCEL")
Next
End If
End Sub
-->
</script>
</HEAD>
<BODY>
<H3>Extend surfaces</H3>
<FORM NAME=test>
<INPUT TYPE=button VALUE=" Apply " onClick=Apply_click() ><p>
</FORM>
</BODY>
</HTML>
Solved! Go to Solution.