Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

DISPLAY ABS UNITS OF POINTS 1

Status
Not open for further replies.

nitan

Automotive
Aug 17, 2006
19
I am making a drawing of a tube structure with centerlines. I need to display the absolute coordinates of the tangency points on the tube paths, or even the model. I want to do this with ext lines or arrows, or just the coords next to the point with an arrow going to it.

Am I missing something simple??

Thanks.

 
Replies continue below

Recommended for you

RMB click in a drawing and select More Dimensions then select whichever style best suits your needs.

[cheers]
Helpful SW websites FAQ559-520​
How to get answers to your SW questions FAQ559-1091​
 
Thank you, unfortunately, the More Dimensions only covers distances, I would like to show the absolute xyz location. All of the extension lines just make things messy.

I would like to do this in a drawing, or on the model display.

Again, thanks for your help.
 
I'm confused ... can you post an image of what you really want and explain what you mean by "absolute xyz location". Absolute from where?

Original Post said:
I want to do this with ext lines ...
Second Post said:
All of the extension lines just make things messy.
????

[cheers]

 
It sounds like you may be trying to do something like this: thread559-155117. It's not great, but it's a usable workaround.
 
HI,

I can't get to the drawing now, but I mean the xyz coordinates from the origin of the coordinate system.
I just want to indicate a point on the path line, and its absolute location without making the drawing or model space cluttered up with extention lines.

Any help would be appreciated.
Thank You.
 
In order to use the macro posted in the thread I linked to you would create a 3D sketch in the model and place a sketch point at each location where you want the XYZ coordinates. Then in the drawing you would show the 3D sketch, select points one at a time and run the macro for each, and then hide the 3D sketch. You would end up with a note with leader pointing to each point of interest giving XYZ coordinates.
 
Hello,
I have run the macro like you said, but I am getting nothing. No instructions or anything.

Am I missing something.
 
Here are the steps for the macro to work correctly:

1. Insert a new 3D sketch in the model.
2. Place sketch points at each location you want coordinates for.
3. Go to the drawing and show that 3D sketch
4. Select one of the sketch points and run the macro

Repeat step 4 for each sketch point in the 3D sketch

5. (Optional) Hide the 3D sketch in the drawing.
 
Actually, I got the instruction for point number, but after I entered the number and hit enter, then I get an message saying "error 438, Object doesn't support this property or method."

Then, I go to debug the macro and the apparent bad line is:

"If SelMgr.GetSelectedObjectType3(1, -1) <> 25 Then".

I'm not sure how to cure this, but if anyone does, it would be appreciated.

I am using Solidworks 2005-2006 student edition. Yeah, I know.

Thanks
 
Here is the whole macro:


Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim longstatus As Long
Dim Annotation As Object
Dim Gtol As Object
Dim DatumTag As Object
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Public Pfx As String
Dim myNote As SldWorks.Note
Dim SelMgr As SldWorks.SelectionMgr
Dim mySketchPoint As SldWorks.SketchPoint
Const FMAT As String = "0,00"
Const SF As Double = 1000
Sub main()

Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
Pfx = InputBox("Enter point number")
Pfx = "POINT " & Pfx & vbCrLf

If SelMgr.GetSelectedObjectType3(1, -1) <> 25 Then
MsgBox "Select a 3D sketch point and run macro again"
Exit Sub
End If

Set mySketchPoint = SelMgr.GetSelectedObject6(1, -1)

Set myNote = Part.InsertNote(Pfx)
If Not myNote Is Nothing Then
myNote.Angle = 0
boolstatus = myNote.SetText(Pfx & "X=" & Format(mySketchPoint.X * SF, FMAT) & _
vbCrLf & "Y=" & Format(mySketchPoint.Y * SF, FMAT) & _
vbCrLf & "Z=" & Format(mySketchPoint.Z * SF, FMAT))
boolstatus = myNote.SetBalloon(0, 0)
Set Annotation = myNote.GetAnnotation()
If Not Annotation Is Nothing Then
longstatus = Annotation.SetLeader2(True, 0, True, True, False, False)
End If
End If
Part.ClearSelection
Part.WindowRedraw

End Sub

 
Interesting. I guess that means that you're a student. Student posting on this forum is discouraged. However, since your version is "2005/2006", I would imagine that the API will be the same as SW 2005. The functions GetSelectedObject6 and GetSelectedObjectType3 are only available in 2006 or later. Try changing

GetSelectedObjectType3(1, -1)
and
GetSelectedObject6(1, -1)

to

GetSelectedObjectType2(1)
and
GetSelectedObject5(1)
 
Hello Mr. Handleman,

Thank you for the solution to my headache. I knew that there had to be a way to do what I wanted, and you helped. It came out just as I wanted it.

Good luck to you.

P.S.
Not a student, just evaluating the prog, and I like it. I'm sure that the real one is even more useful.
 
nitan ... just out of curiosity, would you mind posting an image of the finished dimensioned part/drawing.
See faq559-1100 for details.

[cheers]
Helpful SW websites faq559-520​
How to find answers ... faq559-1091​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor