File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
src/ansys/geometry/core/_grpc/_services/v1 Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 1+ Implement Points V1
Original file line number Diff line number Diff line change @@ -43,10 +43,31 @@ class GRPCPointsServiceV1(GRPCPointsService): # pragma: no cover
4343
4444 @protect_grpc
4545 def __init__ (self , channel : grpc .Channel ): # noqa: D102
46- from ansys .api .geometry .v1 .geometricentities . points_pb2_grpc import PointsStub
46+ from ansys .api .discovery .v1 .design . constructs . datumpoint_pb2_grpc import DatumPointStub
4747
48- self .stub = PointsStub (channel )
48+ self .stub = DatumPointStub (channel )
4949
5050 @protect_grpc
5151 def create_design_points (self , ** kwargs ) -> dict : # noqa: D102
52- raise NotImplementedError
52+ from ansys .api .discovery .v1 .design .constructs .datumpoint_pb2_grpc import (
53+ DatumPointCreationRequest ,
54+ DatumPointCreationRequestData ,
55+ )
56+
57+ from .conversions import from_point3d_to_grpc_point
58+
59+ # Create the request - assumes all inputs are valid and of the proper type
60+ request = DatumPointCreationRequest (
61+ requestData = [
62+ DatumPointCreationRequestData (
63+ points = [from_point3d_to_grpc_point (point ) for point in kwargs ["points" ]],
64+ parent = kwargs ["parent_id" ],
65+ )
66+ ]
67+ )
68+
69+ # Call the gRPC service
70+ response = self .stub .Create (request )
71+
72+ # Return the response - formatted as a dictionary
73+ return {"point_ids" : [p .id for p in response .ids ]}
You can’t perform that action at this time.
0 commit comments