Do you guys know if there is a way to get the planes or origin point of a coordinate feature?
In the image below, you can find a simple extruded essay with a coordinate system (Start1) as an alternative coordinate system.
What I am trying to do is to make the sketch point coincide with the origin of “Start1”. But I’ve been failing all day…
I tried the selection with sketchpoint, extsketchpoint, datumpoint, coordsys, but nothing worked.
Here is the code of the selection generated by macro recorder:
boolstatus = Part.Extension.SelectByID2(“Start1\Point”, “Coordsys”, 0, 0, 0, False, 0, Nothing, 0)
I am working with SW2022 SP4.
Can anyone help me out?
Let’s assume you are able to select the point. What are you going to do with it next?
I need to create a sketch point which is coincident to the origin of the coordinate system.
With that sketch I have to create automatically a dimensioning in a drawing view. The relation of the sketchpoint gives me information about the dimension direction to setup.
For example, if the coord-system has the name “end1_x”, I have to set up a horizontal dimensioning in the xy-plane / view.
Does this make more sense to you now?
This will give you access to the entities that were used to define the coordinate system feature. Perhaps, you can get the coordinates of the entity that was used for the origin and create a sketch point in a 3D sketch.
Let me know if this solves you question.
thanks for your fast respone but unfortunately it’s not solving the problem. It just gives me the access for the entities but I need access to the coordinate system.
The customer prepares the model and will name the coordinate systems - that naming is one important property for my algorithm. Based on the naming I have to create different dimensionings… That means in the drawing I have to run through basic sketches, filter sketchpoints and check the connected coord system. If the coord system has the naming, e.g. end1_x only a horizontal dimension is valid…
Manually it is not a big deal because there you can select the point of the coord system or even the planes but via API I’m not able to fetch them…
If everything fails, you can always try using Mouse Automation. It lets you select an item by its coordinate, just like you would manually. It recently helped me solve a nasty problem.
this is a good one… the first trials passed:
boolstatus = mouse.MoveXYZ(-0.15, 0.05, 0.072, swMouse_Click)
This is only working if SW is in foreground, right? So all I have to ensure is that SW is visible and framestate is not swWindowMinimized?
swApp.Visible = True
swApp.FrameState = swWindowMaximized