XYZ changes for no apparent reason

XYZ changes for no apparent reason

tpover
Contributor Contributor
837 Views
3 Replies
Message 1 of 4

XYZ changes for no apparent reason

tpover
Contributor
Contributor

Hello everyone,

 

I'm still pretty new at programming and the Revit API so I might have overlooked something, but I can't wrap my head around the following situation.

I am trying to create a few pipes and fittings along a line by placing points on that line and use those for creating my pipes.

As you can see in the screenshot I've created an XYZ point2 by a certain offset along the guideline. After that I want to create point3 which is just point2 but with an offset for the Z value. I've color coded the different values I get when I highlight them in Visual Studio and for some reason the X value for point2 has changed between line 197 and 199 for no apparent reason. Does anyone have a clue if I'm missing something here?temp.png

 

 

I have written the same code in Python for Dynamo and it works in that context but I can't understand why it would be different when using it for plugin using C#

 

 

-Taco

 

0 Likes
Accepted solutions (1)
838 Views
3 Replies
Replies (3)
Message 2 of 4

matthew_taylor
Advisor
Advisor
Accepted solution
Taco,
You have point2 and Point2. Check the scope of these variables.

Cheers,

-Matt

Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
0 Likes
Message 3 of 4

tpover
Contributor
Contributor

Argh, stupid! I should've named those two different.

Thanks for the sharp eye Matt 🙂

0 Likes
Message 4 of 4

matthew_taylor
Advisor
Advisor
A pleasure!

Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
0 Likes