.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Integrate Dynamo with Autocad

51 REPLIES 51
SOLVED
Reply
Message 1 of 52
Yonas89
36077 Views, 51 Replies

Integrate Dynamo with Autocad

Hello,

 

I am not sure which forum to choose for my question, thus I hope I have chosen the right one. I have read and watched about Dynamo compatibility with Revit and it looks just amazing. However I use Civil 3d in my daily process which is AutoCAD based and though it's  challenging  to combine Dynamo with AutoCAD, I know it's possible, but I don't know how. I would like to discuss with you guys, maybe you have some experience with it or some thoughts to share. I have found this short video here: https://www.youtube.com/watch?v=oiz76GTN-8Y. Sorry that it's in Russian, don't understand Russian but I get the point that AutoCAD objects could be controlled from Dynamo.

51 REPLIES 51
Message 2 of 52
Alexander.Rivilis
in reply to: Yonas89

@KhasanMamaev

It is a question for you.

 

@Yonas89

You can ask @KhasanMamaev in PM about Dynamo & AutoCAD.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 52
KhasanMamaev
in reply to: Yonas89

Hello. You're right, Dynamo can integrate with AutoCAD. Say what you want to solve the problem and I'll show you a solution.

http://dynamobim.ru
Message 4 of 52
Yonas89
in reply to: Alexander.Rivilis

Hello, thanks a lot for tagging the author of the video. This is great.

Message 5 of 52
Yonas89
in reply to: KhasanMamaev

Hello @KhasanMamaev

I do not have any specific task yet actually, I am just trying to understand the limits of Dynamo  implementation in civil engineering.  I think that Civil 3D with Subassembly composer is okay for making dynamic road. However I am thinking to use Dynamo for making some infrastructure elements such as intersections, roundabouts, driveways or culverts to make it parametric as much as possible.

Message 6 of 52
KhasanMamaev
in reply to: Yonas89

Well, if you do not have a specific task, then I'll show you how to build the line in the open AutoCAD file.

DyAcad MakeLines.jpg

 

restart = IN[0]
if IN[1] != True: off = 1/0

import clr

clr.AddReference('ProtoGeometry')
import Autodesk
from Autodesk.DesignScript.Geometry import *

import System
from System import *

app = System.Runtime.InteropServices.Marshal.GetActiveObject("Autocad.Application")
AcDoc = app.ActiveDocument

lines = IN[2]

def ptA(p):
	return Array[float]([p.X, p.Y, p.Z]) 


for k in lines:
	stpt = ptA(k.StartPoint)
	enpt = ptA(k.EndPoint)
	linn = AcDoc.ModelSpace.AddLine(stpt, enpt)

 

 

http://dynamobim.ru
Message 7 of 52
KhasanMamaev
in reply to: Yonas89

Download Dynamo file https://yadi.sk/d/TEdi5lwcyHmn6

http://dynamobim.ru
Message 8 of 52
KhasanMamaev
in reply to: Yonas89

This inverse problem. Get a dedicated line from AutoCAD

DyAcadTakeLines.jpg

 

restart = IN[0]
if IN[1] != True: off = 1/0

import clr

clr.AddReference('ProtoGeometry')
import Autodesk
from Autodesk.DesignScript.Geometry import *

import System
from System import *

DPoint = Autodesk.DesignScript.Geometry.Point
DLine = Autodesk.DesignScript.Geometry.Line

app = System.Runtime.InteropServices.Marshal.GetActiveObject("Autocad.Application")
AcDoc = app.ActiveDocument

def ptD(p):
	return DPoint.ByCoordinates(p[0],p[1],p[2])

def linD(p1,p2):
	return DLine.ByStartPointEndPoint(ptD(p1),ptD(p2))

sset = AcDoc.PickfirstSelectionSet
n = sset.Count

curvs = []
for i in range(n):
	if sset.Item(i).EntityName == "AcDbLine":
		stpt = sset.Item(i).StartPoint
		enpt = sset.Item(i).EndPoint
		lns = linD(stpt,enpt)
		curvs.append(lns)

OUT = curvs

 

download Dynamo file https://yadi.sk/d/xDnbn2EHyHtdK

http://dynamobim.ru
Message 9 of 52
Slawomir_
in reply to: KhasanMamaev

Hi,

 

I can't find "ForceChildrensEval" on the web. Where can I find this or how can I make this in Dynamo?

Tags (2)
Message 10 of 52
KhasanMamaev
in reply to: Slawomir_

This node from Prorubim DS Common Kit package 

http://dynamobim.ru
Message 11 of 52
Slawomir_
in reply to: KhasanMamaev

Thanks! Is it free for commercial use?

Message 12 of 52
KhasanMamaev
in reply to: Slawomir_

its free

http://dynamobim.ru
Message 13 of 52
Slawomir_
in reply to: KhasanMamaev

I'm stuck. Did complete sample You have shown but now I don't know how to display this Python text window.

 

Dynamo 0.9.1

Message 14 of 52
KhasanMamaev
in reply to: Slawomir_

Double click to Python Script node

http://dynamobim.ru
Message 15 of 52
Slawomir_
in reply to: KhasanMamaev

It's working! Thanks a lot!

Message 16 of 52
KhasanMamaev
in reply to: Slawomir_

Smiley Wink

http://dynamobim.ru
Message 17 of 52
Anonymous
in reply to: KhasanMamaev

is it possible to import information from Excel to property set data in Autocad Architecture?

 

Message 18 of 52
Yonas89
in reply to: Yonas89

Hmm, I think with Dynamo it would be possible but difficult. I think the better option would be to create custum plugin for it.
Message 19 of 52
KhasanMamaev
in reply to: Anonymous

That's possible.

http://dynamobim.ru
Message 20 of 52
KhasanMamaev
in reply to: Yonas89

Of course it would be good to write a plugin, but in what programming language? In Dynamo there are nodes to work with Excel, it is already good

http://dynamobim.ru

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost