Command to drop a shared cell?
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Command to drop a shared cell?

 
Post new topic   Reply to topic    CADForums.net Forum Index -> MicroStation
Author Message
Guest






Posted: Wed Nov 16, 2005 9:10 pm    Post subject: Command to drop a shared cell? Reply with quote

I am trying to drop a specific shared cell to a normal cell so that I
can then batch process replacing some text. This has to be done on 300+
files, so there can't be any user intervention. I have everything
working except for dropping the shared cells to normal cells. I found
this macro posted below, but it causes all of my tags to disappear? Is
there a way to modify this to select a specific shared cell by name or
is there some way to keep it from loosing all of my tags? Any input
would be greatly appreciated

Thanks,
Paul


Const STARTofFILE% = 0

'-----------------------
'VARIABLES
'-----------------------
Dim element As MbeElement
Dim filePos As Long
Dim origin As MbePoint
Dim endOfFile As Long
Dim aantal as Long

'-----------------------------------------------------------
'subroutine ProcessEinde
'-----------------------------------------------------------
Sub ProcessEinde
MbeSendCommand("NULL")
MbeStartDefaultCommand
MbeWritePrompt "The macro is stopped, " + cstr(aantal) + " elements
are dropped"
MbeSendCommand "ECHO"
End
End sub

'-----------------------------------------------------------
'Main
'-----------------------------------------------------------
Sub Main
Set Element = New MbeElement

aantal = 0
endOfFile = MbeDgnInfo.endOfFile
filePos = element.fromFile(STARTofFILE)

'Set a variable associated with a dialog box
MbeSetAppVariable "DROP", "dropOptions.sharedCells", -1&
MbeSetAppVariable "DROP", "dropOptions.sharedToNormal", 1&

While filePos < ENDofFILE AND filePos >= 0

If (element.type = 35) Then
If element.getOrigin(Origin) = MBE_Success Then
aantal = aantal + 1
MbeSendCommand "DROP sharecell "
MbeLocateElement filePos,filePos,0,origin
MbeSendDataPoint 0,0,0,1
End if
End If
filePos = element.fromFile(filePos + element.fileSize)
Wend

ProcessEinde

End Sub

Back to top
Guest






Posted: Fri Nov 18, 2005 1:10 am    Post subject: Re: Command to drop a shared cell? Reply with quote

Paul

Wish I could help you I need to do the same thing.

Please let me know when you find the answer.

Ed Leaders
Back to top
dave
Guest





Posted: Sun Dec 04, 2005 5:10 pm    Post subject: Re: Command to drop a shared cell? Reply with quote

Hi Paul,

Would it be easier just replace the the cell?.
Look for fromto.ma and it will replace your old cell
with new ones without opening any drawing.

Good Luck

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> MicroStation All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB