0

these day, i've done some research that change real masonry wall image into architectural drawing(like CAD,Blueprinting).

so.. my solution is change real masonry image into grayscale image, then convert 0 and 1 numpy array. is this process possible?

and also if i can make image numpy array, then can i import this data array into Dynamo(Revit plugin)?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470

1 Answers1

0

Answering your questions one by one:

  • yes, you can change a real masonry image into a grayscale image
  • yes, you can convert an image into the binary matrix stored in a numpy array
  • yes, you can import this data to Dynamo

What's more, you can actually do all of those in Dynamo using Python Script node starting from importing the image file. If you are working in Revit 2022 you can benefit from CPython and simply import numpy, if older versions, you would have to point to location where numpy is installed.

To do it, first, you need to have numpy for ironpython2.7 (the version used in Revit 2021 and older). Instructions can be found here: How to install numpy and scipy for Ironpython27? Old method doesn't work

Once you have it, simply point in your Dynamo Python Script node to that library location:

import sys 
import clr 
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
import numpy
Artur
  • 31
  • 1
  • 5