×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

xyz points (not curve)

xyz points (not curve)

xyz points (not curve)

(OP)
Hi, how do I insert just points into SW. I'm not looking for curve though points. See attatched.

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2010 SP 5.0
Dell T5500 Windows 7 Pro (64-bit)
Xeon CPU 2.53 GHz 6.00 GB of RAM
nVida Quadro 4000 2 GB
3D Connexion-SpaceExplorer

RE: xyz points (not curve)

Open a 3D sketch, select the sketch point, click, then use the 'Parameters' in the FM to place the point.

Jeff Mirisola
My Blog

RE: xyz points (not curve)

(OP)
Thanks Jeff, but I"m looking to import an excel file or text file with all the values. Trying to avoid doing this manually. I have other files than the one I uploaded.

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2010 SP 5.0
Dell T5500 Windows 7 Pro (64-bit)
Xeon CPU 2.53 GHz 6.00 GB of RAM
nVida Quadro 4000 2 GB
3D Connexion-SpaceExplorer

RE: xyz points (not curve)

I should have figured you already knew that, Colin.

Jeff Mirisola
My Blog

RE: xyz points (not curve)

here is an Excel sheet that has sample code.

RE: xyz points (not curve)

Sorry, I am having problems attaching the file. Here is the code though, you can see the API calls there, and set up your sheet in Excel. I'll try to still post the workbook later.

Option Explicit
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Dim RowNum As Integer
Dim XCoord As Double
Dim YCoord As Double
Dim ZCoord As Double
Private Sub cmdExportPoints_Click()
Set swApp = CreateObject("SldWorks.Application")


Set Part = swApp.ActiveDoc
'Part.Insert3DSketch

RowNum = ActiveCell.Row
XCoord = (Range("B" & RowNum) - Range("J2")) * 0.0254
YCoord = Range("C" & RowNum) * 0.0254
ZCoord = Range("D" & RowNum) * 0.0254

Part.CreatePoint2 XCoord, YCoord, ZCoord
If chkFixPt = True Then
Part.SketchAddConstraints "sgFIXED"
End If
Part.ClearSelection2 True
'Part.InsertSketch2 True
End Sub

Private Sub cmdMirrorPoint_Click()
Set swApp = CreateObject("SldWorks.Application")


Set Part = swApp.ActiveDoc
'Part.Insert3DSketch

RowNum = ActiveCell.Row
XCoord = ((Range("B" & RowNum) - Range("J2")) * (-1)) * 0.0254
YCoord = Range("C" & RowNum) * 0.0254
ZCoord = Range("D" & RowNum) * 0.0254

Part.CreatePoint2 XCoord, YCoord, ZCoord
If chkFixPt = True Then
Part.SketchAddConstraints "sgFIXED"
End If
Part.ClearSelection2 True
'Part.InsertSketch2 True
End Sub

Private Sub Create3dSketch_Click()

Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc
Part.Insert3DSketch
End Sub

Private Sub optFixPt_Click()

End Sub

RE: xyz points (not curve)

(OP)
CBL. the macro locks up on SW2012. At least on my machine. Let me look into Table Driven Patterns.

Grubs, let me try your code. Never did this before.

Thanks all!

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2010 SP 5.0
Dell T5500 Windows 7 Pro (64-bit)
Xeon CPU 2.53 GHz 6.00 GB of RAM
nVida Quadro 4000 2 GB
3D Connexion-SpaceExplorer

RE: xyz points (not curve)

Hi macduff,
You are not going to be interested in all of the code, just the stuff like: Part.CreatePoint2 XCoord, YCoord, ZCoord . You can start a 3d sketch with: Part.Insert3DSketch .

RE: xyz points (not curve)

(OP)
Am I smelling Enhancement request?

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2010 SP 5.0
Dell T5500 Windows 7 Pro (64-bit)
Xeon CPU 2.53 GHz 6.00 GB of RAM
nVida Quadro 4000 2 GB
3D Connexion-SpaceExplorer

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources