←  Technical Questions

nanoCAD forum

»

VBScript addSpline

jan.karnik's Photo jan.karnik 27 Jan 2018

Hello,
I am first time trying to draw some simple objects using Nano Cad. Quite tricky as I was not able to find any programming reference. Can you please help me?

I am attaching my script,

I am getting error err: "TeighaX" raised an exception "Incorrect parameter." at line 32 pos 4 (at Set splineObj =...)

Can you please help?

Thank you
Jan


Sub Example_AddSpline()

	Dim splineObj
	Dim startTan
	Dim endTan
	Dim fitPoints  
	  
	startTan="0.5,0.5,0"
	endTan="0.5,0.5,0"
	fitPoints=array ("1,1,0","5,5,0","10,0,0")
	
	Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)
	
End Sub

call Example_AddSpline()

msgbox("zoom all")

' ZoomAll
ThisDrawing.Utility.Prompt "Perform a ZoomAll"
ThisDrawing.Application.ZoomAll
Quote

Gianfranco Lanza's Photo Gianfranco Lanza 18 Aug 2021

Hello Jan,
also I'm having the same error and I don't understand how to solve it.
Did you find a solution?

Thanks
Gianfranco
Quote