In the Client Server(sept/oct '96) there is a MicroStation Basic code
for replacing points with a cell.
I will e-mail you(and anyone else who wants it) this macro so that you
can run it straight away.
regards
Tor Eivind Ravndal
----------------------------------------------------------------------------
-----------------------------------
'MicroStation BASICware Name: Pnt2cel.bas
'Company: Bentley Systems, Inc.
'Product Category: MicroStation 95
'Platforms tested on: Windows 3.1x, Windows 95
'Keywords: Point, Object, Replace, Cell, Convert,
'BASIC, Macro
'Description: Sample code allows you to change or convert
'all point objects in a design (through a fence or a selection
'set) to cell objects. The current cell name, scale and rotation
'settings are used for cell placement. Feel free to use and
'modify as required.
Richard Humphrey <richard....@infrasoft-civil.com> wrote in article
<37F347AB...@infrasoft-civil.com>...
Then attach a cell library, selected an active cell and now select the the
"Import Coordinates" tool from the same tool box. You'll have to enter the
txt file created above, and the cell name. It wil then proceed to place a
cell at each xy coordinate, which is esentially the location of the text.
Of course, you'll have to delete the text now or turn that level off.
Neat little work around!
Regards,
Inga Morozoff
WorkPlace Wisdom Inc.
Richard Humphrey wrote in message <37F347AB...@infrasoft-civil.com>...
In article <37F347AB...@infrasoft-civil.com>,
richard....@infrasoft-civil.com says...
>
>Hello,
>Does anyone know of a way of replacing all the points within a selection
>with a nominated cell.
You can export cells to a file as xyz text, and then read in the xyz text
and place cells at the points.
Also you can write a fairly simple macro to do it :
(note that this changes cells)
Sub main
Dim element As New MbeElement
Dim filePos As Long
Dim origin As MbePoint
filePos = element.fromFile(0)
Do While filePos >= 0
If element.type = MBE_CellHeader Then
If element.cellName = "ARRO" Then
If element.getOrigin(origin) = MBE_Success Then
MbeSendCommand "place point"
MbeSendDataPoint origin,1%
End If
End If
End If
filePos = element.fromFile(filePos + element.fileSize)
Loop
End Sub
' text2cel.bas
' Based on a macro pnt2cel.bas supplied by
' Phil Chouinard of Bentley
Sub main
Dim elemSet as New MbeElementSet
Dim elem as New MbeElement
Dim setMember as MbeSetMember
Dim opoint as MbePoint
Dim filePos as Long
Dim fileNum as Integer
Dim saveMsgs as Integer
Dim i as integer
i = 1
' turn off messages
saveMsgs = MbeState.messages
MbeState.messages = 0
If MbeSettings.Cell = "" Then
MbeWriteStatus "No cell defined - exiting TEXT2CEL"
Exit Sub
End If
' get element set from either selection set or fence
If elemSet.fromSelectionSet (1) <> MBE_Success Then
If elemSet.fromFence () <> MBE_Success Then
MbeWriteStatus "No fence or selection set - exiting PNT2CEL"
Else
MbeWriteStatus "Processing Fence"
End If
Else
MbeWriteStatus "Processing Selection Set"
End If
status = elemSet.getFirst (setMember)
Do While status = MBE_Success
filePos = elem.fromFile (setMember.filePos, setMember.fileNum)
If elem.type = MBE_Text Then
status = elem.getOrigin (oPoint)
MbeSendCommand "DELETE"
MbeLocateElement setMember.filePos, elem.componentFilePos, _
setMember.fileNum, oPoint
If MbeState.cmdResult <> MBE_ElementNotFound Then
MbeSendDataPoint oPoint
MbeSendCommand "NULL"
MbeSendCommand "PLACE CELL"
MbeSendDataPoint oPoint
MbeSendCommand "NULL"
End If
End If
status = elemSet.getNext (setMember)
MbeWriteStatus "Processing element number " + Str$(i)
i = i + 1
Loop
MbeWriteStatus "Processing completed"
' clear selection set
elemSet.clear
' restore messages
MbeState.messages = saveMsgs
End Sub