Hi there,
Introduction
- First of all, I would like to say that is the 1st time I post ina forum and that I'm a newbie in SolidWorks! (what a combination tostart...). BUT I think i'm a medium programer in VB (VB6 and alittle of VB2005).
- Second, I never felt the need to post questions because theanswers are always on InterNet (read Foruns, execute littleexamples...) or in the help files and its just a question of timeand patient till finding the answer. Well i'm working in thisproject almost for a month (10 hours/day sometimes) and i'mstarting to feel that solidworks is to especific for a type ofaplication and it doesn't make what i want.
- Third, I need in this forum to understand if it is possible toexecute some actions so I can boost my confidence and finish myprogram... or quit and move to another to CAD tool.
- Fourth, I will explain things as a 4 year old because that wasthe way I tried to aproach the solution and probably there is aeasier way.
Well lets cut to the chase:
-» I have to develop a program (a macro !!!) that permitsmarking the "point" of intersection between 2 solids.
For example I have a CUBE and a SPHERE 5 units apart of each other.Starting to getting them closer i want to identify the first POINTof intersection.
Yes I want a POINT... not a VOLUME (Ei... to me, a volume of0,0001m^3 could be considered a POINT!).
The complexity of the program rises because the SPHERE shouldcontinue to MOVE around the cube so i can get other points thatpermits drawing a line, that represents every possibilities ofintersection. Over that line the face of the cube, should bepainted with another colour.
Let me now translate in solidworks language:
As far as I Know and could perform "hand" made... (Without macros)with a CUBE and a SPHERE (two diferents parts assembled in aAssembly type of project), i started moving the SPHERE towards theCUBE using the MOVE comand (inserting the DELTA x displacement),and started to aplly the "FIND INTERFERENCE" comand. When I got aLow Volume of interference (3m^3), I used the
Tools-> SKetch Tools-> Interference Curve. That intersectioncurve between the two solids, is a circle... and the center is thepoint I wanted to know. Next i found in the same way another pointof intersection and finaly draw the line.
When i finished this by hand, i thought it would be "easy game" tostart building a macro using the RECORD method (that everyone usesto startup the constrution of program), right??? WRONG... First ofall calling object in SolidWorks to me is everything but a simpleprocess. But Worse of all is when I RECORDED the move actions andall i got was nothing but simple:
boolstatus = part.Extension.SelectByID2(" (...) ") (only theselection of a SPHERE procedure right ???)
But of course... examples in "Help API of Solidworks". I understoodthat I had to use the comands, like "MoveCopyBodyFeatureData" and"TransformX"... but it still doesn't work (not 100% sure of thecode).
Finaly, after i've show you what troubles me, what i want toknow is:
Is it possible with a macro make the "SPHERE" move?
Is it possible to test the interference until a maximum VOLUME?
Is it possible to PAINT, directly in the assembly, the INTERFERENCEbetween the 2 pieces and making it a part of the assembly? (ItWould Spare the work of making lines)
Is this the right path to the solution ?
Aproching the problem from SolidWorks COSMOS could it becomeeasier???
OR in another words...
Can SolidWorks make my project ???
To anyone that can enlighten me, freeing me from the darkness ofignorance... THANKS
Filipe Pinto, woking in
SOLIDWORKS Ver. Education Edition 2007 SP3.1
PS: PLEASE HELP!!! And sorry if along the post ive broken any rule
SolidworksApi macros




Introduction
- First of all, I would like to say that is the 1st time I post ina forum and that I'm a newbie in SolidWorks! (what a combination tostart...). BUT I think i'm a medium programer in VB (VB6 and alittle of VB2005).
- Second, I never felt the need to post questions because theanswers are always on InterNet (read Foruns, execute littleexamples...) or in the help files and its just a question of timeand patient till finding the answer. Well i'm working in thisproject almost for a month (10 hours/day sometimes) and i'mstarting to feel that solidworks is to especific for a type ofaplication and it doesn't make what i want.
- Third, I need in this forum to understand if it is possible toexecute some actions so I can boost my confidence and finish myprogram... or quit and move to another to CAD tool.
- Fourth, I will explain things as a 4 year old because that wasthe way I tried to aproach the solution and probably there is aeasier way.
Well lets cut to the chase:
-» I have to develop a program (a macro !!!) that permitsmarking the "point" of intersection between 2 solids.
For example I have a CUBE and a SPHERE 5 units apart of each other.Starting to getting them closer i want to identify the first POINTof intersection.
Yes I want a POINT... not a VOLUME (Ei... to me, a volume of0,0001m^3 could be considered a POINT!).
The complexity of the program rises because the SPHERE shouldcontinue to MOVE around the cube so i can get other points thatpermits drawing a line, that represents every possibilities ofintersection. Over that line the face of the cube, should bepainted with another colour.
Let me now translate in solidworks language:
As far as I Know and could perform "hand" made... (Without macros)with a CUBE and a SPHERE (two diferents parts assembled in aAssembly type of project), i started moving the SPHERE towards theCUBE using the MOVE comand (inserting the DELTA x displacement),and started to aplly the "FIND INTERFERENCE" comand. When I got aLow Volume of interference (3m^3), I used the
Tools-> SKetch Tools-> Interference Curve. That intersectioncurve between the two solids, is a circle... and the center is thepoint I wanted to know. Next i found in the same way another pointof intersection and finaly draw the line.
When i finished this by hand, i thought it would be "easy game" tostart building a macro using the RECORD method (that everyone usesto startup the constrution of program), right??? WRONG... First ofall calling object in SolidWorks to me is everything but a simpleprocess. But Worse of all is when I RECORDED the move actions andall i got was nothing but simple:
boolstatus = part.Extension.SelectByID2(" (...) ") (only theselection of a SPHERE procedure right ???)
But of course... examples in "Help API of Solidworks". I understoodthat I had to use the comands, like "MoveCopyBodyFeatureData" and"TransformX"... but it still doesn't work (not 100% sure of thecode).
Finaly, after i've show you what troubles me, what i want toknow is:
Is it possible with a macro make the "SPHERE" move?
Is it possible to test the interference until a maximum VOLUME?
Is it possible to PAINT, directly in the assembly, the INTERFERENCEbetween the 2 pieces and making it a part of the assembly? (ItWould Spare the work of making lines)
Is this the right path to the solution ?
Aproching the problem from SolidWorks COSMOS could it becomeeasier???
OR in another words...
Can SolidWorks make my project ???
To anyone that can enlighten me, freeing me from the darkness ofignorance... THANKS
Filipe Pinto, woking in
SOLIDWORKS Ver. Education Edition 2007 SP3.1
PS: PLEASE HELP!!! And sorry if along the post ive broken any rule

SolidworksApi macros