CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.094.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator. New AutoCAD 2026 commands and variables.
Plex.Earth connects AutoCAD and Google Earth
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic Closedvba for generating drawing notes....some error

 Post Reply Post Reply
Author
venkatramreddyp View Drop Down
Newbie
Newbie


Joined: 03.Dec.2009
Status: Offline
Points: 1
Direct Link To This Post Topic: vba for generating drawing notes....some error
    Posted: 03.Dec.2009 at 17:17
Dear all,

i have created a vba for generating drawing notes using autodesk inventor
almost of the vba is done, but the program lines given below are having some error
Please help me in correcting this........

Thanks & Regards
venkatramreddyp
 
*********************************************
Option Explicit

Global Const version = 2.55
Global Const sDataFilePathAndName = "F:\venkat\inventor\latest\catia\CommonNotes.ini"

Global InvApp As Application
Global InvDoc As Document
Global DrawDoc1 As DrawingDocument
Global vDoc1 As Variant

Global DrawSheets1 As DrawingSheets
Global DrawSheet1 As DrawingSheet
Global DrawViews1 As DrawingViews
Global DrawView1 As DrawingView
Global DrawTexts1 As DrawingTexts
Global DrawText1 As DrawingText
Global DrawLeader1 As DrawingLeader

Global sFileType As String
Global bMainViewIsActive

Global Selection1
Global sStatus1 As String
Global PointLocation1(1)

Global bStatus As Boolean
Global CustomNote As String

Sub INVmain()

Dim InvApp As Inventor.Application
Set InvApp = ThisApplication
On Error Resume Next
Set InvDoc = InvApp.ActiveDocument
On Error GoTo 0


If Not (InvDoc Is Nothing) Then


sFileType = TypeName(InvDoc)


If sFileType = "DrawingDocument" Then
Set DrawDoc1 = InvDoc
Set DrawSheets1 = DrawDoc1.Sheets
Set DrawSheet1 = DrawSheets1.ActiveSheet
Set DrawViews1 = DrawSheet1.Views
Set DrawView1 = DrawViews1.ActiveView
Set DrawTexts1 = DrawView1.Texts

If (DrawView1.Name = "Main View") Then
bMainViewIsActive = True
Else
bMainViewIsActive = False
End If


Set Selection1 = DrawDoc1.Selection

If (Selection1.Count 1) Then
Selection1.Clear

Load frmStatus
frmStatus.txtSelect.Text = "Select Note Insertion Point"
frmStatus.Show vbModeless
DoEvents
End If

Set vDoc1 = DrawDoc1
sStatus1 = vDoc1.Indicate2D("Select Note Insertion Point", PointLocation1)

frmStatus.Hide
DoEvents

If (sStatus1 = "Cancel") Then
Unload frmStatus
Exit Sub
End If

FormSelectNotes.Show vbModal
Else
MsgBox "Current document is not a Drawing." & Chr(13) & Chr(13) _
& "Please load/activate a Catia " & Chr(13) _
& "drawing and try again.", vbExclamation
End If
Else
MsgBox "No active Drawing found in Catia." & Chr(13) & Chr(13) _
& "Please load/activate a Catia " & Chr(13) _
& "drawing and try again.", vbExclamation
End If
End Sub
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,084 seconds.