Sketch Lines - Edit, Copy, Paste

@Hyunu_Kim That might work, but it would then require the end user click ‘ok’ on the sketch before you could move onto other documents, which means we would be required to use the Revit user interface in each item we run the check on, which means we can’t process a list, which is very un-Dynamo in nature so I’d go a different root.

I am at an Autodesk conference this week, just started a new role at Autodesk last week, and have a lot of my usual responsibilities from the old role, my usual voluntary and outreach stuff ongoing, and a few ‘new job’ efforts going on so I can’t take the deep dive, but I can give my usual guidance to someone who wants to try to do so, and doubly so if they want to learn how to do this type of work on their own… you appear to meet those last two requirements so in that vein below is a list of steps I would tackle the first attempt at making this work, using some non-formatted Python where I felt like it could come in handy.

Try this:

Use a select model elements to select two walls, one with the edited sketch and one without. Then copy one of my Python nodes, open it up, and try the following (read everything through before you start, remember to check the comments carefully, and note that the comments you leave will make your next edit that much easier if you are overly clear in your documentation):

  1. The line which imports the necessary sections from the Autodesk.Revit.DB class should include the Wall class (or change it to a wild card).
  2. The inputs get wiped out
  3. define the variable “wallList” as something like wallList = UnwrapElement(IN[0])
  4. Read up on the CreateProfileSketch method to convert to a non-sketch based element to a sketch based one CreateProfileSketch Method
  5. everything after the inputs and before the transactions gets wiped out.
  6. everything between the transaction nodes gets wiped out
  7. define the variable outcomes as an empty list something like outcomes =
  8. inside the transaction, start a new for loop along the lines of “for wll in wallList: “
  9. in the offset line below start a new ‘try:’ statement
  10. in the twice offset line below call the convert method on the wll object as the variable ‘attempt’, something like attempt = wll. CreateProfileSketch()
  11. append the resulting attempt to the outcomes list using something like outcomes.append(attempt)
  12. slide back to the “try” level, and start the ‘except:’
  13. in the doubly offset line below set the attempt variable to a handle failure message, something like ‘attempt = “well this didn’t work but I am not sure why yet” ’
  14. append the resulting attempt to the outcomes list using something like outcomes.append(attempt)
  15. after the transaction end line we only need to ensure our walls are passed along to the Dynamo environment, so clear everything after the transaction ending to the end of the code
  16. define our output as something like OUT = outcomes

Make sure you save often to keep things from getting lost should you crash; that is the Python code and the DYN - if you only do one you might lose work.

This will NOT allow the sketch to be edited in the same dynamo run, as per the remarks section of the CreateProfileSketch… but if you can’t make it work by itself is then you can’t make it work as part of the larger workflow… so baby steps we go. :slight_smile:

If you (or anyone else feeling adventurous) give it a shot let me know.

1 Like