Rotation Angle Indicator Error

dynamo
#1

Hi All:

I’m beginner in Dynamo for one of the project, try to get the value of Angle with Radians based on the Dynamo manual. But it doesn’t have the correct outcome as show in picture. Is there anyway I can have value in 360. Anyone can help. Thanks

Thanks & Regards:
KSF

0 Likes

#2

I don’t understand well your question, but from what I can see, the output of your python script is already in degrees (based in 360). So if you don’t convert them into radians, that’s the result you are looking for.

0 Likes

#3

What the value require was after 180 deg it should be 225 deg (But some how it value it back to 135 deg). I try many way but it can’t works.

0 Likes

#4

You’ll have to post the content of the python script as the angles are coming out of it. But the idea is to place a conditional in the script that every time the angle goes over 180, add the amount you required.

0 Likes

#5

Still Don’t understand, need more advice. As I’m new user system not allow me to attach dyn.

Code:
pt1=Point.Origin();
pt2=List.FirstItem(points);
restpts=List.RestOfItems(points);
pt3=pt2.Add(Vector.ByCoordinates(0,0,1));
plane1=Plane.ByThreePoints(pt1,pt2,pt3);
circle1=Circle.ByCenterPointRadius(pt1,1);
cs1=CoordinateSystem.ByPlane(plane1);
cylinder1=circle1.ExtrudeAsSolid(1);
checkgeom=cylinder1.Transform(cs1);
arcs=Arc.ByCenterPointStartPointEndPoint(pt1,pt2,restpts);
null;
bool1=checkgeom.DoesIntersect(restpts);

0 Likes

#6

We need to know what is inside this node:

Doble click and copy what is inside here. Thankss

0 Likes

#7

Code:
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
clr.AddReference(‘DSCoreNodes’)
import DSCore
from DSCore import *
#The inputs to this node will be stored as a list in the IN variable.
list1=IN[0]
member=IN[1]
bool1=IN[2]
cnt=len(list1)
ind=0
indices=
while ind<cnt:
if list1[ind]==member:
indices.append(0)
else:
angle=list1[ind].SweepAngle
indices.append(angle)
ind=ind+1

ind=0
cnt=len(bool1)
adjustlist=
while ind<cnt:
adjust=0
if bool1[ind]==1:
adjust=indices[ind]
else:
adjust=360-indices[ind]
adjustlist.append(adjust)
ind=ind+1

#Assign your output to the OUT variable
OUT = adjustlist

0 Likes

#8

Ok, next time try to preformat the code you copy, it makes everyone lives much easier:

Well, I think replacing this in your python script will give you what you need:

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
clr.AddReference(‘DSCoreNodes’)
import DSCore
from DSCore import *
#The inputs to this node will be stored as a list in the IN variable.
list1=IN[0]
member=IN[1]
bool1=IN[2]
cnt=len(list1)
ind=0
indices=[]
while ind<cnt:
	if list1[ind]==member:
		indices.append(0)
	else:
		angle=list1[ind].SweepAngle
		indices.append(angle)
	ind=ind+1

#Assign your output to the OUT variable
OUT = indices

Or you can just change your last line of code to:

#Assign your output to the OUT variable
OUT = indices
0 Likes

#9

Completely off topic but is there a dark mode feature of this website that I never knew about?

0 Likes

#10

I’m not sure if there is one, but I use this extension for Chrome:

There are similar ones for Firefox or Opera.

1 Like

#11

Thanks. Will try tomorrow. Morning

0 Likes

#12

Hi architectcoding:

This was the outcome based on the code that you share, but there is still some differences on the schedule that I can’t understand. 164.5 and 359 deg is acceptable, but the 74.5 (Totally no idea…??)

Regards:
Kan

0 Likes

#13

Hi, it’s difficult to pinpoint an unique error in the result when the others work well without testing it.
Any chance you can share the script and the file you’re working on?

0 Likes