Thanks for watching Mostafa! We will go ahead and put that on our suggested topics list, we host these live trainings every Thursday, so be sure to subscribe at ketiv.com/ava
Very useful video, everything work at perfection, but now I try to change the code so I can run it on a assembly with multiple occurrences and I can't make it to wotk. Any help from you if you coul give a hint about this issue ?
This is a very useful video for dimension automation by API or iLogic. But can you add an example of how to find correct occurrence in multi model in a assembly case?
Hello KEVIT team, thanks for sharing informative video... But i have tried to run the code as shown... Was not able to execute / not working.... Can i please get VBA code script would be really helpful..
Your video was very informative and helpful. I worked along side your video to create the code for the item that I was trying to dimension as well. It seemed to work but as soon as I run it inventor shuts down. Any idea what would cause that?
Hi, i used AttributeManager for drawing with part file and they work very good. But i try with assembly file, this is error, the message appears : " run-time error'13' / Type mismatch ". The code is the highlighted debug code,I want to explain a little bit here, as I want to use attributemanater to define the face ( not edge) and automatically dimensions on the many Views ( As I said above, if you use your code with the part file, it works very well): Sub CreateDimensionAssembly() 'Reference the file that's open Dim oDrawDoc As DrawingDocument Set oDrawDoc = ThisApplication.ActiveDocument 'Reference the active sheet Dim oSheet As Sheet Set oSheet = oDrawDoc.ActiveSheet 'Reference the View we want Dim oView As DrawingView Set oView = oSheet.DrawingViews.Item(1) 'Reference the Assembly on that view Dim oAssembly As AssemblyDocument Set oAssembly = oView.ReferencedDocumentDescriptor.ReferencedDocument 'Reference the Model on that sheet 'Dim oModelDoc As Document 'Set oModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument 'Create a shortcut to the General Dimensions on the sheet Dim oGeneralDims As GeneralDimensions Set oGeneralDims = oSheet.DrawingDimensions.GeneralDimensions 'Find the Model referenced in the Assembly For i = 1 To oAssembly.ReferencedDocuments.Count Set oModelDoc = oAssembly.ReferencedDocuments.Item(i) 'Find Face 1 on the model Dim Face1 As Face Set oObjs = oModelDoc.AttributeManager.FindAttributes("DIM", "FACE", "RIGHT") Set Face1 = oObjs.Item(1) '
informative video, I actually was following you along but I have an error in the last line and I have tried to fix it and understand where it comes from but with no gain and I write this comment disappointedly to help me out of this problem the code i have written is " Sub CreateDimensionModel() 'Reference the file that's open Dim oDrawDoc As DrawingDocument Set oDrawDoc = ThisApplication.ActiveDocument 'Reference the active Sheet Dim oSheet As Sheet Set oSheet = oDrawDoc.ActiveSheet 'Reference the View we want Dim oView As DrawingView Set oView = oSheet.DrawingViews.Item(1) 'Reference the Model on that Sheet Dim oModelDoc As Document Set oModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument ' Create a shortcut to the General dimensions on the sheet Dim oGeneralDims As GeneralDimensions Set oGeneralDims = oSheet.DrawingDimensions.GeneralDimensions 'Find edge 1 (Left) on the Model Dim Edge1 As Edge Set oObjs = oModelDoc.AttributeManager.FindObjects("*", "*", "Left") Set Edge1 = oObjs.Item(1) 'Find edge 1 (Right) on the Model Dim Edge2 As Edge Set oObjs = oModelDoc.AttributeManager.FindObjects("*", "*", "Right") Set Edge2 = oObjs.Item(1) 'Promote to an DrawingCurve on the View Dim OCurves1 As DrawingCurve Set OViewCurves1 = oView.DrawingCurves(Edge1) Set OCurves1 = OViewCurves1.Item(1) Dim OCurves2 As DrawingCurve Set OViewCurves2 = oView.DrawingCurves(Edge2) Set OCurves2 = OViewCurves1.Item(1) 'Promote to a geometryintent onthe sheet Dim GI1 As GeometryIntent Set GI1 = oSheet.CreateGeometryIntent(OCurves1) Dim GI2 As GeometryIntent Set GI2 = oSheet.CreateGeometryIntent(OCurves2) 'Create a point for the text Dim Textpoint As Point2d Dim Xpos As Double Dim Ypos As Double Xpos = oView.Left + (oView.Width / 2) Ypos = oView.Top + 3 Set Textpoint = ThisApplication.TransientGeometry.CreatePoint2d(Xpos, Ypos) 'Create the Dimension Dim oDim1 As GeneralDimension Set oDim1 = oGeneralDims.AddLinear(Textpoint, GI1, GI2) End Sub " Thanks for help
this is one of the best videos on the topic of Drawings Automation, thanks to all of you; can you make another video like this but for balloons?
Thanks for watching Mostafa! We will go ahead and put that on our suggested topics list, we host these live trainings every Thursday, so be sure to subscribe at ketiv.com/ava
Very useful video, everything work at perfection, but now I try to change the code so I can run it on a assembly with multiple occurrences and I can't make it to wotk. Any help from you if you coul give a hint about this issue ?
This is a very useful video for dimension automation by API or iLogic. But can you add an example of how to find correct occurrence in multi model in a assembly case?
Hello KEVIT team, thanks for sharing informative video... But i have tried to run the code as shown... Was not able to execute / not working.... Can i please get VBA code script would be really helpful..
Good morning Sunny. Thanks for reaching out. We could potentially provide the samples. Please email us at support@ketiv.com
Your video was very informative and helpful. I worked along side your video to create the code for the item that I was trying to dimension as well. It seemed to work but as soon as I run it inventor shuts down. Any idea what would cause that?
Hi Brad. I can't provide any insight as to what's happening on your particular install. Are you using the most up-to-date Inventor build?
besst video for me !
Glad to hear that!
Hi, i used AttributeManager for drawing with part file and they work very good.
But i try with assembly file, this is error, the message appears : " run-time error'13' / Type mismatch ".
The code is the highlighted debug code,I want to explain a little bit here, as I want to use attributemanater to define the face ( not edge) and automatically dimensions on the many Views ( As I said above, if you use your code with the part file, it works very well):
Sub CreateDimensionAssembly()
'Reference the file that's open
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
'Reference the active sheet
Dim oSheet As Sheet
Set oSheet = oDrawDoc.ActiveSheet
'Reference the View we want
Dim oView As DrawingView
Set oView = oSheet.DrawingViews.Item(1)
'Reference the Assembly on that view
Dim oAssembly As AssemblyDocument
Set oAssembly = oView.ReferencedDocumentDescriptor.ReferencedDocument
'Reference the Model on that sheet
'Dim oModelDoc As Document
'Set oModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
'Create a shortcut to the General Dimensions on the sheet
Dim oGeneralDims As GeneralDimensions
Set oGeneralDims = oSheet.DrawingDimensions.GeneralDimensions
'Find the Model referenced in the Assembly
For i = 1 To oAssembly.ReferencedDocuments.Count
Set oModelDoc = oAssembly.ReferencedDocuments.Item(i)
'Find Face 1 on the model
Dim Face1 As Face
Set oObjs = oModelDoc.AttributeManager.FindAttributes("DIM", "FACE", "RIGHT")
Set Face1 = oObjs.Item(1)
'
Have you got solution. I getting error of "invalid argument" with line of code. Just i have used "*" in place of "DIM" and "FACE".
@@rishabhshanker3329 Many thanks for answer me.
I tried your way. But the error is still reported in the next line "Set Face1 = oObjs.Item (1)"
Hi, Could you please share the code for this?
Thanks!
Take a look at our iLogic starter kit here: ketiv.com/automation-diy-kit/
how can I get the "geometry" tab in the ilogic tab?
What version of Inventor are you using Lennart?
@@KETIVTechnologies I use Inventor 2019
informative video, I actually was following you along but I have an error in the last line and I have tried to fix it and understand where it comes from but with no gain and I write this comment disappointedly to help me out of this problem
the code i have written is "
Sub CreateDimensionModel()
'Reference the file that's open
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
'Reference the active Sheet
Dim oSheet As Sheet
Set oSheet = oDrawDoc.ActiveSheet
'Reference the View we want
Dim oView As DrawingView
Set oView = oSheet.DrawingViews.Item(1)
'Reference the Model on that Sheet
Dim oModelDoc As Document
Set oModelDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
' Create a shortcut to the General dimensions on the sheet
Dim oGeneralDims As GeneralDimensions
Set oGeneralDims = oSheet.DrawingDimensions.GeneralDimensions
'Find edge 1 (Left) on the Model
Dim Edge1 As Edge
Set oObjs = oModelDoc.AttributeManager.FindObjects("*", "*", "Left")
Set Edge1 = oObjs.Item(1)
'Find edge 1 (Right) on the Model
Dim Edge2 As Edge
Set oObjs = oModelDoc.AttributeManager.FindObjects("*", "*", "Right")
Set Edge2 = oObjs.Item(1)
'Promote to an DrawingCurve on the View
Dim OCurves1 As DrawingCurve
Set OViewCurves1 = oView.DrawingCurves(Edge1)
Set OCurves1 = OViewCurves1.Item(1)
Dim OCurves2 As DrawingCurve
Set OViewCurves2 = oView.DrawingCurves(Edge2)
Set OCurves2 = OViewCurves1.Item(1)
'Promote to a geometryintent onthe sheet
Dim GI1 As GeometryIntent
Set GI1 = oSheet.CreateGeometryIntent(OCurves1)
Dim GI2 As GeometryIntent
Set GI2 = oSheet.CreateGeometryIntent(OCurves2)
'Create a point for the text
Dim Textpoint As Point2d
Dim Xpos As Double
Dim Ypos As Double
Xpos = oView.Left + (oView.Width / 2)
Ypos = oView.Top + 3
Set Textpoint = ThisApplication.TransientGeometry.CreatePoint2d(Xpos, Ypos)
'Create the Dimension
Dim oDim1 As GeneralDimension
Set oDim1 = oGeneralDims.AddLinear(Textpoint, GI1, GI2)
End Sub
"
Thanks for help
Hi Mostafa, this is a very in depth question, I would suggest reaching out to us for consulting help by contacting us at ketiv.com/contact-us