CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > CAM Software > BobCad-Cam


BobCad-Cam Discuss all BobCad software here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 07-09-2009, 09:48 PM
Chipload's Avatar  
Join Date: Apr 2007
Location: United States
Posts: 41
Chipload is on a distinguished road
BobCAD V20 Script, Loop Syntax?

Working on scripting to generate Gcode. So far all the code is working for one of my projects. However when I incorporate a Loop function in the script it dose not run. Is anyone here done a loop function in BobCAD V20 script to generate Gcode? If so, how dose the syntax work for the loop function.
Reply With Quote

  #2   Ban this user!
Old 07-09-2009, 11:31 PM
 
Join Date: Jan 2006
Location: USA
Age: 45
Posts: 605
stevespo is on a distinguished road

What type of loop? I'm not much of a VB developer, but this should work for a counted loop.

For I = 1 To N
blah, blah
Next I
Reply With Quote

  #3   Ban this user!
Old 07-10-2009, 12:55 AM
 
Join Date: Dec 2008
Location: usa
Posts: 1,849
BurrMan is on a distinguished road

Try:

For Index = ----
----------
----------
Next Index
Reply With Quote

  #4   Ban this user!
Old 07-10-2009, 05:12 PM
Chipload's Avatar  
Join Date: Apr 2007
Location: United States
Posts: 41
Chipload is on a distinguished road

The project that I am working on will write code to heli-mill a hole. My program is working except that I am not able to loop the part to mill the helix.
Attached Files
File Type: txt SpiralHole03.txt‎ (2.9 KB, 41 views)
File Type: txt Gcode.txt‎ (528 Bytes, 38 views)
Reply With Quote

  #5   Ban this user!
Old 07-10-2009, 06:31 PM
 
Join Date: Dec 2008
Location: usa
Posts: 1,849
BurrMan is on a distinguished road

Sorry, I dont have 20 to be able to test the script. Maybe someone else can jump in here.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 07-12-2009, 11:00 AM
 
Join Date: Mar 2005
Location: USA
Posts: 315
moldmker is on a distinguished road

Originally Posted by Chipload View Post
The project that I am working on will write code to heli-mill a hole. My program is working except that I am not able to loop the part to mill the helix.
I can look at this more as I get time.

But a quick glance showed there was no For/Next loop defined at your start/end loop comments.

Also, are you familiar with the Step checkbox when you run the script from the CAD side?
This opens a window that shows the script being executed line by line. You can also list variables to monitor their values during execution.

Somewhere...I have a script written to do this very operation, but can't find it now.

moldmker
Reply With Quote

  #7   Ban this user!
Old 07-12-2009, 09:17 PM
 
Join Date: Mar 2005
Location: USA
Posts: 315
moldmker is on a distinguished road

Here's your script back.

Added:

1. For/Next loop to create helical code.

2. Function that checks to see if total depth divided by pitch = whole number. If not, the pitch is altered so that # of turns is a whole number.(caution required if threadmilling)

3. Various small changes to clean up code.

See if this works for you.
I checked only for math errors and code output, I didn't try to break it or see how it would act with various +/- inputs. (read: no warranty expressed or implied)

Cool thing about scripts is they can be changed to give the EXACT code you want to see at the machine.

moldmker
Attached Files
File Type: txt SPIRAL~1-rje.txt‎ (3.5 KB, 38 views)
Reply With Quote

  #8   Ban this user!
Old 07-16-2009, 06:30 PM
Chipload's Avatar  
Join Date: Apr 2007
Location: United States
Posts: 41
Chipload is on a distinguished road

Thank you all for your replies. The script is working now. Moldmker, cheers to you

My knowledge in VB is dangerous at best. But it is getting better.
Reply With Quote

  #9   Ban this user!
Old 09-09-2009, 08:26 PM
 
Join Date: Jul 2006
Location: US
Age: 45
Posts: 702
Ed from NY is on a distinguished road

I have searched, but I did not find anything other than the examples in this thread and a couple of pages in the help file.

How do we even access this feature?

Where do we put scripting files?

How do we refer to these features in BobCad so that they get picked up?

Thanks!
Reply With Quote

  #10   Ban this user!
Old 09-09-2009, 08:44 PM
 
Join Date: Apr 2008
Location: USA
Posts: 502
SBC Cycle is on a distinguished road

Ed, there is some info on the BobCAD support forum site about scripting. It is NOT in the scripting section however. That area is mostly reserved for V21 and older scripting.

http://www.bobcadsupport.com/forum/s...ead.php?t=4016

This should give you a quick crash course.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 09-10-2009, 12:38 AM
 
Join Date: Jul 2006
Location: US
Age: 45
Posts: 702
Ed from NY is on a distinguished road

Interesting, not quite what I was thinking...

In Summary: You define extra parameters for existing features in files named PostName.FeatureName and you place these in the post folder. These parameters will be displayed as a "Adv Posting" item in the feature tree. Then you then put VB code in your post to access these variables and do things.

The problem is that the post only knows how to do very simple things... So if you want to create a replacement feature (or intercept an existing feature) to "pocket circular holes" or do "simple profiling of an open chain consisting of a single line" your plug-in point is too low in the chain.

There is a "Null tool change" script element that perhaps together with "Tool change" gets called at least once for each feature. If the VB variables you create continue to exist in between calls to post building blocks you might be able to get creative there.

May be you can use it to optionally remove unwanted cycles that BobCad does not remove, for example I have not found a way not to generate the milling step in the reaming feature, setting the tool diameter to 0 does not work in this instance.

Hmmm... even if it works there might be other gotchas
Reply With Quote

  #12   Ban this user!
Old 09-10-2009, 02:51 AM
 
Join Date: Dec 2008
Location: usa
Posts: 1,849
BurrMan is on a distinguished road

Originally Posted by Ed from NY View Post
May be you can use it to optionally remove unwanted cycles that BobCad does not remove, for example I have not found a way not to generate the milling step in the reaming feature, setting the tool diameter to 0 does not work in this instance.
Ed,
Editing the toolpattern can remove ops from a feature. Does this not do what you are talking about here?
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Loop to Closed Loop Stepper Conversion beamhome Stepper Motors and Drives 9 05-24-2012 02:46 AM
BOBCAD Model Airplane Wing Design Script cely BobCad-Cam 6 08-20-2009 10:11 PM
Need help with VB script Syntax Please. Adamj12b Mach Software (ArtSoft software) 6 09-18-2008 07:18 AM
Need Help!- Bobcad and script letters Claude Boudreau BobCad-Cam 6 03-25-2008 05:50 AM
question on closed loop vs open loop (servo systems) boonie Servo Motors and Drives 20 11-09-2007 12:30 PM




All times are GMT -5. The time now is 12:54 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361