Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using iLogic to anchor dimension locations

6 REPLIES 6
Reply
Message 1 of 7
BrynSaunders
1319 Views, 6 Replies

Using iLogic to anchor dimension locations

Hi there, I have a drawing that looks to a parametric part for its views. I have created a ilogic rule that auto scales the views regardless of the part size so that they will always fit into the designated sheet size. The problem I am having is that when the part changes, the dimensions in the drawing get all muddled up and do not retain their locations. Is there a way to anchor these locations? I have searched through the forum and found these two posts that have the same problem as me, unfortunately no solution has been offered. http://forums.autodesk.com/t5/Inventor-General/Dimension-Placement-updates/m-p/3195838/highlight/tru... http://forums.autodesk.com/t5/Inventor-General/variable-dimensions-in-a-idw/m-p/2908098/highlight/tr... The posts are quite old and I was wondering if any body could help me? Thank you
6 REPLIES 6
Message 2 of 7
VdVeek
in reply to: BrynSaunders

BryanSaunders, as far as i can find it's not posible to anchor dimensions. But i found this thread: http://forums.autodesk.com/t5/Inventor-Customization/Command-Manager-and-iLogic-Automation-not-worki... in here you find an ilogic rule that selects all the dimensions in the drawing and arrange them. Maybe that's workable for you. (the arrange command is also available when a dimension is selected under the right mouse button)

Rob.

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 3 of 7
BrynSaunders
in reply to: VdVeek

Hi VdVeek, thank you for your reply. I seems a pity that there is no proper solution to this. From reading on the other posts people seem to think it is possible but only through 3rd party applications or extensive coding. I will check out the link to see if i can implement it into my drawing. If I select all the dimensions and right click and select arrange dimensions, it seems quite random where they end up. I gather this is what the code will do. Anyways is will keep at it.
Message 4 of 7
ad64
in reply to: BrynSaunders

I don't know about drawings, but it is definitely possible to maintain / manipulate dimension positions in a sketch. In the Sketch Repair Tool that I wrote in iLogic, I store all the dimensions with their locations in a matrix, delete them off of the sketch and then replace them (after the code runs) in the exact place where they were before. Maybe you could do something similar in the drawing environment. The code for the sketch repair tool is here:

http://forums.autodesk.com/t5/Inventor-General/Sketch-Repair-amp-Enhancement-Tool-written-in-iLogic/...

 

You'll find the relevant code under the "Master Code" rule. Hope this helps.

 

Steve

Message 5 of 7
VdVeek
in reply to: ad64

Steve. The problem is when you use parametric parts or assemblies. Dimensions placed in an IDW won't always move the right way when changing the size of an object. When you draw a lot of products that are the same shape but change in size this problem with the dimensions occur. It would be nice to have some sort of dimension snap, to link the dimensions at a sketch which changes with the part shape.

Rob.

Autodesk Inventor 2015 Certified Professional & Autodesk Inventor 2012 Certified Professional.
Message 6 of 7
g.boessenj
in reply to: BrynSaunders

Hello Bryn!

 

I noticed in your forum post that you said you had figured out some iLogic to Autoscale the drawing, no matter what size it was, to fit the page.  Do you have still or would you be willing to share that iLogic code or how you came about doing it? My team and I are working on something very similar to what your trying to do with a varible product line as well and we have the same issue with some of our larger/ "wide size range" parts.   I know this doesnt help your question but it could really help us if you don't mind.

 

Gabe B.


@"BrynSaunders wrote:
Hi there, I have a drawing that looks to a parametric part for its views. I have created a ilogic rule that auto scales the views regardless of the part size so that they will always fit into the designated sheet size."

 

Message 7 of 7
MechMachineMan
in reply to: g.boessenj

g here is a the relevant portion of the algorithm I use. It makes the first view 1/6 of the sheet size.

Dim oSheet As Sheet = ThisApplication.ActiveDocument.ActiveSheet
Dim oView1 As DrawingView = oSheet.DrawingViews(1)
Dim oArea As Double = oSheet.Height * oSheet.Width

Dim oViewArea As Double = oView1.Height * oView1.Width

'MsgBox("Sheet Area: " & oArea & vbLf & "View Area: " & oViewArea & vbLf & "View Scale: " & oView1.Scale)

oView1.Scale = oViewScale * ((oArea/6)/(oViewArea))



--------------------------------------
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

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

Post to forums  

Autodesk Design & Make Report