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: 

Select case (choose with X,Y Coordinates to use)

1 REPLY 1
Reply
Message 1 of 2
Anonymous
265 Views, 1 Reply

Select case (choose with X,Y Coordinates to use)

SyntaxEditor Code Snippet

I can't seem to get this working, Iám trying to make a sweep (a automated railing with steel pipes)
now the sweep goes fine now what goes wrong is that de X-Y coordinates of the steel pipe changes in every
different plane x,y,z position i try to recognize this if the points are positief or negatief and the select case

Railing.jpgognize and change te x and y coordinates but it iám doing something wrongRailing2.jpg

Dim
oCircle As SketchCircle Dim XoCircle As Double Dim YoCircle As Double Dim xP1 As Double xP1 = oP1.Geometry.X Dim yP1 As Double yP1 = oP1.Geometry.Y Dim zP1 As Double zP1 = oP1.Geometry.Z Dim xP2 As Double xP2 = oP2.Geometry.X Dim yP2 As Double yP2 = oP2.Geometry.Y Dim zP2 As Double zP2 = oP2.Geometry.Z MsgBox("StartPoint: " & CStr(oP1.Geometry.X) & " , " & CStr(oP1.Geometry.Y) & " , " & CStr(oP1.Geometry.Z) _ & vbLf & "EndPoint: " & CStr(oP2.Geometry.X) & " , " & CStr(oP2.Geometry.Y) & " , " & CStr(oP2.Geometry.Z)) Select Case XoCircle And YoCircle Case xP1<=0, yP1>=0, xP2<=0, yP2>=0 XoCircle = 0 YoCircle = 0 Messagebox.Show("1") Case xP1<=0, yP1<=0, xP2<=0, yP2<=0 XoCircle = 0 YoCircle = 3 Messagebox.Show("2") Case xP1 <= 0, yP1 >= 0, xP2 <= 0, yP2 <= 0 XoCircle = 0 YoCircle = 3 Messagebox.Show("3") ' Case Else ' XoCircle = 0 ' YoCircle = 0 End Select
1 REPLY 1
Message 2 of 2
MechMachineMan
in reply to: Anonymous

1. Partial code is fun to work with. If we are to try experimenting with stuff to see what works, now we have to code the rest of it to see what happens.

 

2. Not entirely sure where you are pulling your points from to being with. Is it 1 sketch? Is it multiple sketches? is it workpoints?


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

Technology Administrators


Autodesk Design & Make Report