Everybody is good, in a piece of code below red line there is an error, please correct me, thank you!
The Variant swApp, part;
String Name=ExtractFilePath (Application - & gt; ExeName) + 1. "SLDPRT";
SwApp=the Variant: : CreateObject (" SldWorks. Application ");
SwApp. OlePropertySet (" Visible ", true);
Part=swApp. OleFunction (" competing OpenDoc, "the Name. The c_str (), 1);
(part. OleFunction (" Parameter ", "1" D1 @ sketch)). OlePropertySet (" SystemValue ", 0.2);
(part. OleFunction (" Parameter ", "removal - stretching 1")). OleFunction (" EditDelete "); EditRebuild3 part. OleFunction (" ");
I used to record the SolidWors own macros, as follows:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main ()
The Set swApp=_
Application. SldWorks
The Set Part=swApp. ActiveDoc
Dim myModelView As Object
The Set myModelView=Part. ActiveView
MyModelView. FrameState=swWindowState_e. SwWindowMaximized
Boolstatus=Part. The Extension. SelectByID2 (" removal - stretching 1 ", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0)
Part. EditDelete
Boolstatus=Part. EditRebuild3 ()
End Sub
But still don't know how to change, for help,
CodePudding user response:
"Removal - stretching 1" isn't this command error?
CodePudding user response:
reference 1st floor xjq2003 response: "removal - stretching 1" isn't this command error? I seemed to understand some of the VB boolstatus=Part. The Extension. SelectByID2 (" removal - stretching 1 ", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0) Is to use the selected "removal - stretching 1" this characteristic, reoccupy EditDelete this to delete, but my question is how to select in BCB "removal - stretching 1" this feature? Then use part. OleFunction (" EditDelete ") is ok; CodePudding user response:
Where is the demon elder brother? demon elder brother in where? where is the demon elder brother? CodePudding user response:
Please welcome OLE profession of demon elder brother... CodePudding user response:
The sink to the bottom of the ocean CodePudding user response:
Is not the old demon don't back to you, but to reply to you, just need to install the software testing, 6-7 G too big too much trouble, you can compare your issue here is clear, still need you fumble, the key is how to select "removal" (part. OleFunction (" Parameter ", "removal - stretching 1")). OleFunction (" EditDelete "); -- "guess you should use this method is similar to (part. OleFunction (" SelectByID2 ", "removal - stretching 1")). OleFunction (" EditDelete "); Such, SelectByID2 behind this parameter to consult your recording that script, CodePudding user response:
refer to 6th floor zzbinfo response: this is not the old demon don't back to you, but would like to reply you, you need to install the software testing, 6-7 G too big too much trouble, you can compare your issue here is clear, still need you fumble, the key is how to select "removal" (part. OleFunction (" Parameter ", "removal - stretching 1")). OleFunction (" EditDelete "); -- "guess you should use this method is similar to (part. OleFunction (" SelectByID2 ", "removal - stretching 1")). OleFunction (" EditDelete "); So, SelectByID2 behind this parameter to consult your recording that script, Ah, BCB learning materials is too little, I'd better to bypass this way, I decided to use the VB programming, encapsulated into a DLL, in c + + builder call again, CodePudding user response:
Everybody who has a Visual Basic 6.0 installation package, to send a, thank you! Email 88580882 @163.com CodePudding user response:
What do you do this using VB to do or use the BC is the same, you are through OLE, all want to solve the problem of corresponding to the calling function and parameters,