.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

need sample code for Plot in VB.net

2 REPLIES 2
Reply
Message 1 of 3
hbhlm
411 Views, 2 Replies

need sample code for Plot in VB.net

I want to write some code .net to batch-plot several drawings , and also during process, a dialog is avaible for user to cancel the plotting. Can anyone tell me where to find sample code related to plot in vb.net? Thanks.
2 REPLIES 2
Message 2 of 3
mohnston
in reply to: hbhlm

As you can tell by the deafening silence there is little to no sample code or even documentation on plotting.

If you use the Publish mechanism you will get AutoCADs progress dialog which has the Cancel button built in.
CAD Programming Solutions
Message 3 of 3
Anonymous
in reply to: hbhlm

the cancel can be done with a doevents statement in the loop.
I do this with a batch image converter.
This is some sample code that gives the idea, but is dependent on other functions of course:

Public Sub ConvertImgCSandType(ByVal e As MtClickEventArgs, ByVal exts As String, ByVal colorSpace As
ImageManip.colorSpaces, ByVal imgExt As ImageManip.ImgExtensions)
Dim formStatus As New frmStatus
Try
Dim SelectedItems() As String = GeteFilteredFiles(e.SelectedItems, exts)
If Not SelectedItems Is Nothing Then
Dim useFolder As String = Path.GetDirectoryName(SelectedItems(0))
If IsFldrReadOnly(useFolder) = True Then
'see if user wants to create locally
If MsgBox("Folder is Read-Only, Create File on Desktop instead?", MsgBoxStyle.YesNo, "Question") =
MsgBoxResult.Yes Then
useFolder = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
End If
End If
formStatus.Startup(SelectedItems.GetUpperBound(0) + 1)
'do items
Dim i As Integer = 0
While formStatus.Cancel = False And i < SelectedItems.GetUpperBound(0) + 1 '<---Loop starts here
If formStatus.CanFocus = True Then formStatus.OneMore()
ImageManip.ReColorImg(SelectedItems(i), colorSpace, useFolder, imgExt)
Application.DoEvents() '<--- do events here, this means check if other forms have been picked
i += 1
If formStatus.CanFocus = True Then formStatus.OneMoreDone()
End While
End If
Catch ex As Exception
End Try
If Not formStatus Is Nothing Then formStatus.FadeClose() 'formStatus.Close()
End Sub

the idea is to use a global var that the loop checks before continuing.


hbhlm <>
|>I want to write some code .net to batch-plot several drawings , and also during process, a dialog is avaible for user to cancel the plotting. Can anyone tell me where to find sample code related to plot in vb.net? Thanks.
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost