Topo Add Points - API Guru help needed


#1

I am trying to add points to a Topo in Revit via Python and Dynamo. I have managed to successfully create a topo using Python (getting points from locations of families) but i cannot seem to get a similar code to work to add points. It seems that the issue is somewhat related to needing to use TopographyEditScope and being unable to Commit that, but i really can’t tell.


#2

Here’s the code for creating a topo if anyone comes across this thread in a search (the rest is the same as above…)

Topo Create


#3

It seems like it should work as you have a ilist and they are xyz coordinates, what error does it give you?

 

You tried swapping the topoint to the xyz() command?


#4

See line 55 - I am using (trying to use) AddPoints.

The issue is that to use AddPoints you first must enter into the TopographyEditScope mode (which seems to require some gymnastics to work around transaction modes if doing it via Dynamo). That’s what I’m looking for help with.


#5

Just noticed you are forcing the closure of the transaction when it should be a commit function


#6

It has something to do with that, but per the “0.6.3 to 0.7 migration” post on GitHub, there is no “Commit” for transactions in Dynamo. The usual “Transaction TaskDone” line resulted in an error (something about the model being in a read-only mode, and it referred back to the TopographyEditScope.Start line). Not by my computer right now so I cannot post a pic of what happens when I do that…


#7

Replaced Line 57 with:

TransactionManager.Instance.TransactionTaskDone()

Below is an image of the resulting error :

Topo Add Points Error


#8

Hi Ben,

Would you mind posting your code on stackoverflow:

http://stackoverflow.com/search?q=revit-api+revit

I’ll have a look a bit later

Edit:

I did give it a try. Unfortunately, it seems that Dynamo is incapable of initiating a proper “TopographyEditScope”. The python interpreter says that the TES is active, but any attempt to modify the input topo, results in an error. For reference, similar code executed in RevitPythonShell, runs without a hitch:

 

I suggest you file an issue report on this.


Topography adjusting points
#9

Alternatively, have you considered the following:

1)extract the points from the existing topo

2)delete the old topo

  1. add the new points to the list of ex. points

  2. create a new topo with all the points


#10

Thanks Dimitar for not only verifying that it won’t work, but explaining why.

I will file a report on the problem.

I was trying to avoid the delete/recreate workaround because in principle I think that is the wrong thing to do (tags, dimensions, graphic overrides, etc all are toast after a delete/recreate). So close…and yet so far away.