Wombat disabled Vectors in Code blocks

Hello everyone,

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.

before wombat:
image

after wombat:
image

I’m using Revit 2018 and Dynamo 1.3.2.

Any help will be appreciated!

@Brian_Ringley3

Try DSCore.Vector.XAxis

The issue you’re facing is one often met by people using Codeblocks without fully understanding what is actually happening inside :slight_smile: It has nothing to do with Wombat specifically :wink: Have a look in this discussion if you’re interested in understanding why this happens

Hi Jonathan,

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?

Thanks!

Hi and yes I can…

As Wombat contain a namespace that uses “Vector” you installing it means that there are now two namespaces with the same prefix (“Vector”)

  1. OOTB (Out Of The Box)
  2. 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…

  1. (OOTB): Autodesk.Vector.XAxis()
  2. (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:

3 Likes

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?

Firstly I do not understand your need for using imperative for this simply definition…
Secondly you might be able to get around your issues like so:

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.

But thanks anyway!

As @Jonathan.Olesen shows, it can be used in a loop, but you need to assign the method to a variable outside the imperative block as a workaround. This is a known issue: https://github.com/DynamoDS/Dynamo/issues/8796

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. :slight_smile:

That works perfectly. Thanks @Avz !

1 Like