Place drawing view in drawing sheet using Ilogic or VBA!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, please accept the challenge for my question. I need to place a drawing view on a active drawing sheet using Ilogic.
1. Run the rule
2. select the view for the drawing to be placed from my opened part document (part document is now activated).
3. Go to the drawing sheet (Drawing document is now activated for placing the drawing)
4. Instead of co-ordinates, I want interface and mouse to move my drawing on the sheet so that i could place the views where ever I want.
5. Another part document will be opened.
6. The steps 2,3 &4 will be repeated.
I have written the some part of the code for my part document open and drawing document. please share your knowledge on this!!!
Dim oPartDoc As PartDocument
Dim FSO As Scripting.FileSystemObject 'call the filesystemobject or Tools < Refernces < MS scripting
Set FSO = New Scripting.FileSystemObject
Dim FolderRef As Scripting.Folder
Dim FileRef As Scripting.File
Job = InputBox("Enter the Job: ", "Job Tiltle", "8856 or 9354")
folderpath = "\\inventor\Inventor\Projects\R" & Job & "\FLAT COVER"
Set FolderRef = FSO.GetFolder(folderpath)
Set oDoc = ThisDocument
Dim oPoint4 As Point2d
Dim Count As Integer
Count = 0
For Each FileRef In FolderRef.Files
If Left(FileRef.Name, 7) = "COVER B" Or Left(FileRef.Name, 6) = "CT ROD" Then
Count = Count + 1
End If
Next
MsgBox ("The Extra part count is" = Count)
For Each FileRef In FolderRef.Files
If Left(FileRef.Name, 7) = "COVER B" Or Left(FileRef.Name, 6) = "CT ROD" Then
Set oPartDoc = ThisApplication.Documents.Open(folderpath & "\" & FileRef.Name)
Dim oObject As Object
Set oObject = ThisApplication.CommandManager.Pick(kPartFeatureFilter, "Pick a Face or Edge to continue")
Call oPartDoc.Close
Dim oBorder As Border
Set oBorder = oSheet.Border
oDoc.Activate
Dim x, y, j As Integer
j = 1
'Select Case Left(FileRef.Name, 7)
'Case "COVER B"
Set oPoint4 = ThisApplication.TransientGeometry.CreatePoint2d(oBorder.RangeBox.MinPoint.x + 8, oBorder.RangeBox.MinPoint.y + 😎
Dim oView4 As DrawingView
Set oView4 = oSheet.DrawingViews.AddBaseView(oPartDoc, _
oPoint4, 0.07, kCurrentViewOrientation, kHiddenLineRemovedDrawingViewStyle)
'Dim oSheet As Sheet
Set oSheet = oDoc.Sheets.Item(1)
ThisApplication.ActiveView.Fit
End If
Next