Object position on Drawing

Object position on Drawing

Anonymous
Not applicable
1,041 Views
5 Replies
Message 1 of 6

Object position on Drawing

Anonymous
Not applicable

Hello,

 

How can I get a Sketched Symbole position on drawing?

I want to positioning one Sketched Symbole if size of sheet is change.

 

Thank you in advance.

1,042 Views
5 Replies
Replies (5)
Message 2 of 6

kleiton.narcizo
Enthusiast
Enthusiast

Hi.

I create stitches to help me position my Sketched Symbols (connection point grip). They serve as reference and are linked.

 

Look at the attachment.

 

Regards

Tom

 

 

0 Likes
Message 3 of 6

MechMachineMan
Advisor
Advisor

Something like this should do the trick for you:

 

 

Option Compare Text

Sub Main()
    Dim oDoc As Document = ThisDoc.Document
    
    For Each oSheet In oDoc.Sheets
        Call MoveSketchedSymbols("BENT PART", 20, 20)
    Next
End Sub

Private oSheet As Sheet

Sub MoveSketchedSymbols(oName As String, oXLoc As Integer, oYLoc As Integer)
    Dim oSketchedSym As SketchedSymbol
	For Each oSketchedSym in oSheet.SketchedSymbols
        If oSketchedSym.Name Like oName Then
            Dim oPt As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(oXLoc, oYLoc)
            oSketchedSym.Position = oPt
        End If
    Next  
End Sub 

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 4 of 6

Anonymous
Not applicable

Thank you the answer.

It was work previously, but I don't want to run it all the time just when it need.

So if the paper size not change the rule is not run.

That's why I want to compare the current position of sketched symbole with the paper size.

0 Likes
Message 5 of 6

MechMachineMan
Advisor
Advisor

Hi,

 

If you want it to run at a pre-determined time, and not on demand, you will need to use event triggers to decide when it is run.

 

Also, you can simply program in some checking of the sheet size and move it to the proper location based on sheet size.

 

Using the programming help, browsing the forms, or using google, you should be able to easily find documentation/samples for this.

 

http://help.autodesk.com/view/INVNTOR/2018/ENU/?query=Sheet.size

 

Good luck!


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 6 of 6

Anonymous
Not applicable

Hi,

 

What I need is two coordinates of Sketched sybole (x and y).

At save if this coordinates are correct to paper size the rule (what is already done) not run.

 

So I just need two coordinates what I can compare and this will be condition to the run.

0 Likes