Sketched Symbol with Sheet number

Sketched Symbol with Sheet number

Anonymous
Not applicable
691 Views
6 Replies
Message 1 of 7

Sketched Symbol with Sheet number

Anonymous
Not applicable

On a multi page drawing, I want a sketched symbol to placed on a upper right hand side,  “For BOM, see Sheet: X” to be placed on every sheet except the sheet where the parts list available on the drawings. Also the Sketched symbol promped entry automatically filled up with the sheet number (Partslist page). Please hele me on this. 

0 Likes
Accepted solutions (1)
692 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable

You could make a custom iProperty in the drawing file and read this property with the sketched symbol. This way you only need to set the iProperty with the sheet number containing the partslist once. All sheets will then update with the correct sheet number.

 

Daniël

0 Likes
Message 3 of 7

Anonymous
Not applicable

Thanks Daniel for your reply. but to know if there any way, This is the existing VBA code what I have, 

 

On Error GoTo ErrHandler
Set oSketchedSymbolDef = oDrawDoc.SketchedSymbolDefinitions.Item("For BOM See Sheet: ")
Set osheet = oDrawDoc.ActiveSheet

' This sketched symbol definition contains one prompted string input. An array
' must be input that contains the strings for the prompted strings.
Dim sPromptStrings(0) As String
sPromptStrings(0) = "1"

Dim oTG As TransientGeometry
Set oTG = thisapplication.TransientGeometry

For Each osheet In oDrawDoc.Sheets
osheet.Activate

If osheet.Name <> "Sheet:1" Then
Dim oSketchedSymbol As SketchedSymbol
Set oSketchedSymbol = osheet.SketchedSymbols.Add(oSketchedSymbolDef, oTG.CreatePoint2d(81.7, 52.7), (0), 1, sPromptStrings)
oSketchedSymbol.Static = True
End If
Next

0 Likes
Message 4 of 7

Anonymous
Not applicable

What exactly is your problem with this code?

0 Likes
Message 5 of 7

Anonymous
Not applicable

Current code actually puts (It assumes Partslist is on the first sheet), so it updates the remaining sheets with the sketched symbol, Now the code to be modified by placing the sketched symbol on all sheets, except the sheet if the parts list sheet. (If the partslist present on sheet2, this sketched symbol should not be inserted into this sheet. But the same to be inserted in all the sheets)

0 Likes
Message 6 of 7

Anonymous
Not applicable
Accepted solution

You could use someting like this:

 

Dim sBOMSheet as string

Dim oSh as SHeet

 

For each oSh in Activedocument.Sheets

  if Not oSh.partslists.count =0 then

      sBOMSheet = oSh.name

      exit for

  end if

next oSh

 

I haven't tested it, just typed it in this message (so there could be typos in it). With this code you can find the sheet which contains the partslist. Hope you get the idea.

 

Daniël

0 Likes
Message 7 of 7

Anonymous
Not applicable

Thanks Daniel, this code works

0 Likes