Macro Help
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
Macro Help

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






Posted: Mon May 09, 2005 4:10 pm    Post subject: Macro Help Reply with quote

This macro is supposed to read an element's level and increment it by
known number. What is wrong with it?

sub main()
Dim element as New MBEElement
Dim filepos as long
filePos = element.fromFile (0)
Do While filePos >= 0
if element.isgraphics <> 0 Then
element.level = mbeelement.level + 13
stat = element.rewrite()
End if
filePos = element.fromFile(filePos + element.fileSize)
Loop
End sub

Back to top
Rob
Guest





Posted: Tue May 10, 2005 12:10 am    Post subject: Re: Macro Help Reply with quote

Mark,

If you are running the Basic Macro in v8 then look up the help files as the
number is no called LevelCode or something like that...

If in v7 I have made a small change

sub main()
Dim element as New MBEElement
Dim filepos as long
Dim lngLevel as Long
filePos = element.fromFile (0)
Do While filePos >= 0
if element.isgraphics <> 0 Then
' ************* TRY THIS
element.level = element.level + 13
stat = element.rewrite()
End if
filePos = element.fromFile(filePos + element.fileSize)
Loop
End sub
<Mark.Madsen@Bayercropscience.com> wrote in message
news:1115647338.083429.224530@f14g2000cwb.googlegroups.com...
Quote:
This macro is supposed to read an element's level and increment it by
known number. What is wrong with it?

sub main()
Dim element as New MBEElement
Dim filepos as long
filePos = element.fromFile (0)
Do While filePos >= 0
if element.isgraphics <> 0 Then
element.level = mbeelement.level + 13
stat = element.rewrite()
End if
filePos = element.fromFile(filePos + element.fileSize)
Loop
End sub
Back to top
Guest






Posted: Tue May 10, 2005 4:10 pm    Post subject: Re: Macro Help Reply with quote

To answer your question. I am running this in V8. Does anyone know
what element.level translates to in V8 for this macro to work?

Thanks

Back to top
Rob
Guest





Posted: Wed May 11, 2005 12:10 am    Post subject: Re: Macro Help Reply with quote

....LevelCode

MbeElement.Level doesn't work as it did due to the change in level number
structure.

LevelCode replaces it to handle Long Integers

Look in the MS Basic Help files under MBEElement and the functions
underneath it or ask here... http://discussion.bentley.com/

<Mark.Madsen@Bayercropscience.com> wrote in message
news:1115733087.825296.117450@o13g2000cwo.googlegroups.com...
Quote:
To answer your question. I am running this in V8. Does anyone know
what element.level translates to in V8 for this macro to work?

Thanks
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
Powered by phpBB