View Single Post
  #2  
Old 08-06-2005, 16:08
RobC
Guest
 
Posts: n/a
Default

I would recommend making your own regmarks. Either create a file with your regmark in it which you will import and color and place, or draw it from scratch each time with the corelDraw objects.


here is a snippet I wrote for a client

Code:
 'do regmarks
    
        If chkRegMarks.Value = True Then
            
            On Error Resume Next
            dDoc.Pages(1).Activate
            If numLayers > 1 Then
                'import the first one
                ActiveLayer.Import adors!regmark_file, 1795
                adors.Close
                Set myReg = dDoc.ActiveShape
                'clone it to the opposite corner
                ActiveSelection.Clone dDoc.ActivePage.SizeWidth - (2 * ActiveSelection.PositionX + ActiveSelection.SizeWidth), dDoc.ActivePage.SizeHeight - (2 * ActiveSelection.PositionY + ActiveSelection.SizeHeight)
                
                iOutline = 497
                CMDColorQ.Parameters(2) = arrColors(0, 0, 1)
                Set rsColorIndex = CMDColorQ.Execute
                iOutline = rsColorIndex(1)
                
                iFill = 545 'white fill
                CMDColorQ.Parameters(2) = arrColors(0, 1, 1)
                Set rsColorIndex = CMDColorQ.Execute
                iFill = rsColorIndex(1)
                
                For Each s In myReg.Shapes
                    s.Outline.Color.PaletteIndex = iOutline
                    s.Fill.UniformColor.PaletteIndex = iFill
                Next
                
                myReg.CreateSelection
                'make all the other reg marks
                For i = 2 To numLayers - 1
                    dupRegMarks
                    Set myReg = dDoc.ActiveShape
                    ActiveSelection.Clone dDoc.ActivePage.SizeWidth - (2 * ActiveSelection.PositionX + ActiveSelection.SizeWidth), dDoc.ActivePage.SizeHeight - (2 * ActiveSelection.PositionY + ActiveSelection.SizeHeight)
                     CMDColorQ.Parameters(2) = arrColors(0, i, 1)
                    Set rsColorIndex = CMDColorQ.Execute
                    iFill = 545
                    iFill = rsColorIndex(1)
                    
                    For Each s In myReg.Shapes
                        s.Outline.Color.PaletteIndex = iOutline
                        s.Fill.UniformColor.PaletteIndex = iFill
                    Next
                    myReg.CreateSelection
                Next
            End If


Code:
Sub dupRegMarks()
    ' Description: Duplicates reg mark down the size of exising reg mark
    '
    ActiveShape.Duplicate(0, -ActiveShape.SizeHeight).CreateSelection
End Sub
I only import my regmark 1 time, then use the DupRegMark routine to duplicate it into the correct location. Coloring this regmark works easily because it consists of a circle with a fill and outline, and crosshairs consisting of outline only and no visible fill. The other neat trick here is cloning the regmarks into the mirror-image location (upper left mirrors to lower right). I only need to color the regmark once to also affect the clone, and later, when I want to delete or re-apply new regmarks, i only need to lasso the originals, and all of them get deleted.

the only other note I should add is that cmdColorQ (which I reference) is an ADO query that returns the color values that I will be applying. Your values will obviously come from someplace else.
Reply With Quote