Is it possible to gather coordinate information in a drawingby picking a surface in a view, return one value and insert it intotext? We often create drawings for mock-up models that require onlyone view with elevation dimensions (see attached). Currently, wetransfer dimensions from one view to another which can introduceerrors. Multi-view drawings are not an option for this particularapplication.
I can create some basic macro programming but I haven't been ableto make much headway with where to start on this. Any help would bemuch appreciated- thanks in advance!SolidworksApi macros
I can create some basic macro programming but I haven't been ableto make much headway with where to start on this. Any help would bemuch appreciated- thanks in advance!SolidworksApi macros

Is it possible to gather coordinate information in a drawing bypicking a surface in a view, return one value and insert it intotext?
What I am looking for is I would like to return the Y coordinatefor the part surface. To clarify, the surfaces that are shown inthe previous image are always planar to the top plane at somedistance- I need this dimension from the top plane (the Y axis fromthe origin) to be transfered to text and placed anywhere on thesurface in the drawing. I experimented with some code to gathercoordinates in the part model but it doesn't return the correctvalues in the drawing.
Hope this helps to clarify and clear things up!
Linkto file
Your problem will be with model-space coordinates and translatingfrom an actual 3D model position to a relative drawing-spacecoordinate. I had absolute nightmares doing a program for a clientnot so long ago to get point locations from a drawing, its far farmore tricky than simply saying here is my position. You have to usetransform and translation matrix, space conversions and a few moretricks depending on the conditions.
How important is this task?
This is exactly what I was looking for!!! It would be nice if itwere parametric, but this will do the trick. Thanks!!!
John
This task is pretty important to us- otherwise, we have to manuallytransfer every dimension to a text box and type it in. Take a lookat the macro that Josh posted- it works great once you understandhow it works (took me a few minutes to figure out the "selectother" that it was looking for). I may alter it to be more usefulfor our needs, but it does the trick!
Glad it fit your needs. There's certainly plenty of room for it tobe improved - UI... error trapping... even comments!
What you are doing is just getting 2D drawing points, not actual 3Dmodel points into model space coordinates so what you are asking isvery basic it is just a case of getting the selected points as theexample macro does. Nothing really to comment on as its just a caseof GetSelectionPoint2 and however you want to go about that.