I have been using Wombat Package for creating a roof and it works well. The problem is that when I run old scripts with vectors inside loops (Code blocks) they are not being recognized as vectors. Here’s an example of what I’m getting.
The issue you’re facing is one often met by people using Codeblocks without fully understanding what is actually happening inside It has nothing to do with Wombat specifically Have a look in this discussion if you’re interested in understanding why this happens
I went through the discussion but still I don’t find where’s the problem with the vector. I thought it was Wombat because as soon as I noticed the problem I uninstalled the package and the vector code worked as usual. Can you illustrate a bit more where is the issue?
As Wombat contain a namespace that uses “Vector” you installing it means that there are now two namespaces with the same prefix (“Vector”)
OOTB (Out Of The Box)
Wombat package
This means that when you are creating a codeblock instead of using the node… You need to define which method you wish to use…
(OOTB): Autodesk.Vector.XAxis()
(Wombat) WombatDynamo.Vector…
The easiest way to discover the appropriate namespace is to use the node and use the “node to code” option which appears when choosing a node and rightclicking the canvas.
All these are actually different ways to say the same thing in a codeblock:
Thanks Jonathan! That was a very clear way of differentiating both types.
Now that I’m using the appropriate way of defining vectors I found that it’s not working when used inside imperative logic. The namespace must change if I’m using imperative?
This simple definition is an example. The real issue in my script is inside a loop, for which I use imperative.
From what I’m seeing, its not possible to have it inside the imperative.
Anyway, for a more comprehensive example, if you write ptByCoords = Autodesk.Point.ByCoordinates;
you can then use ptByCoords(x,y,z);
just as you would normally use the original method, within the imperative block.