TurboCAD Forums

The Ultimate Resource for TurboCAD Knowledge

Register
 
When replying to a specific statement be sure to quote the previous post.

Groups?
Read 4062 times
* June 09, 2009, 11:36:26 AM
Hi--Have just recently started trying to sort out how to customize TC with a few programs of my own.   Currently I am working on a html/vbscript that runs in the Internet Palette, reads a file and plots a set of oriented symbols based on the file data (x, y, z, bearing). 

The symbol has severa lines and I would like to link them into a group after I draw them.   My problem is that I can't figure out how to do that.  I see methods for creating blocks and exploding groups, but not creating groups.  What am I missing?

Any help greatly appreciated.

Logged


* June 09, 2009, 02:14:55 PM
#1
A very good question, Brooks. I'll try to find the answer for you!

Kevan

Logged


* June 09, 2009, 04:41:25 PM
#2
Here's one way: Select the objects that you want to group, then use the AddGroup method of the Selection object.

ex.
----------------------------------------------
'MakeAGroup.vbs'
option explicit
Dim TCApp
Dim TCDraw
Dim TCGraphics
Dim TCGroupGraphic
Dim TCSel
Dim TempGraphic

On Error Resume Next
Set TCApp = CreateObject("TurboCAD.Application")
TCApp.Visible = True
Set TCDraw = TCApp.Drawings.Add("")
Set TCGraphics = TCDraw.Graphics
Dim TCGraphic
Set TCGraphic = TCGraphics.AddCircleCenterAndPoint (0, 0, 0, 2, 0, 0)
TCGraphic.Selected = True
Set TCGraphic = TCGraphics.AddLineSingle (-2, 0, 0, 2, 0, 0)
TCGraphic.Selected = True
Set TCGraphic = TCGraphics.AddLineSingle (0, 0, 0, 0, 2, 0)
TCGraphic.Selected = True
Set TCSel = TCDraw.Selection
Set TCGroupGraphic = TCSel.AddGroup("NewGroup")
------------------------------------------------------------------

« Last Edit: June 10, 2009, 06:57:01 AM by kchapman »

Logged


* June 10, 2009, 05:06:32 AM
#3
Thanks! I will give that a try and report back.  Appreciate the speedy response!

Logged


* June 10, 2009, 07:07:01 PM
#4
Thanks Kevan--your code got me through my problem.  If you are interested I have posted the utility that I was working on to the Contributions forum.

Logged