Design Script Question


#1

Hey guys,

I’m in the process of learning to use DesignScript through the Code Blocks and ran into this little problem. I’m not sure if i’m missing something really simple or not.

When trying to use certain functions such as CoordinateSystem.XYplane in the Code Block, i’m confused as to the inputs required and why it pushes back the error “Warning: Cannot find static method or constructor”.

Below is an example of what I mean showing two different methods.

Cheers,

Jeremy.
Test


#2

Every node you call in a codeblock expects the same number of inputs as the node itself. I’m quite new to this myself, but I think you have to define b=Point.ByCoordinates(a,0,0) so that Coordinatesystem.ByOrigin(b) will work. Either that or you have to define 3 inputs in the Coord.byorigin.


#3

Thanks Jostein but the problem doesn’t seem to be with CoordinateSystem.By Origin, this part of the code works just fine. That is exactly why i assumed CoordinateSystem.XYPlane would work in the same fashion. Unfortunately it doesn’t even though the node only requires a coordinate system as the input.


#4

Ok, but what is the b input in the CoordinateSystem.ByOrigin pointing to?


#5

Sorry Jostein, you are right, that was a mistake as i quickly threw that example together. Below shows what i mean with that error updated.

cheers,

Jeremy

Test2


#6

try c.XYPlane()


#7

Hey Michael,

 

unfortunately that didn’t seem to do it although it does make sense. shown below.

Capture

 


#8

 

20140809-1

Regards,

Vikram Subbaiah


#9

Yep, ,that does the trick, thanks Vikram.


#10

Hello Jeremy Graham;

Try this c.XYPlane;

As it is a property on CoordinateSystem so it should work like this.

Will provide you more details tomorrow once I am in office.

Thanks,

Ritesh


#11

XYPlane


#12

That works fine too, thanks Ritesh!