Skip to content
Discussion options

You must be logged in to vote

Maybe the following will help you. You can use the CwPlane3d and CwVector3d from cwmath

import sys
import cadwork
import element_controller as ec

sys.path.append("C:\\...\\.venv\\Lib\\site-packages")

from cwmath.cwplane3d import CwPlane3d
from cwmath.cwvector3d import CwVector3d

if __name__ == '__main__':
    element_ids = ec.get_user_element_ids()
   
    # this could be some element axis (xl, yl, zl)
    plane_normal = CwVector3d(0.000000, -0.500000, 0.866025)
    plane_location = CwVector3d(-42.500000, 1644.450845, 3432.000000)
    plane = CwPlane3d(plane_location, plane_normal)
    distance = plane.distance_to_point(CwVector3d(0.0, 0.0, 0.0))

    for element_id in element_ids:
   …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@roehligas
Comment options

@Brunner246
Comment options

@roehligas
Comment options

@Brunner246
Comment options

Answer selected by roehligas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants