Make lines into construction lines

Make lines into construction lines

Anonymous
Not applicable
1,341 Views
9 Replies
Message 1 of 10

Make lines into construction lines

Anonymous
Not applicable

Hi,

 

Is it possible to access sketch lines in a sketch and switch them between "normal" lines and contruction lines?

0 Likes
1,342 Views
9 Replies
Replies (9)
Message 2 of 10

Cadmanto
Mentor
Mentor

RC on the lines, select properties and select a different line type style.

 

check.PNGIf this solved your issue please mark this posting "Accept as Solution".

Or if you like something that was said and it was helpful, Kudoskudos.PNG are appreciated. Thanks!!!! Smiley Very Happy

 

New EE Logo.PNG

Inventor.PNG     vault.PNG

Best Regards,
Scott McFadden
(Colossians 3:23-25)


0 Likes
Message 3 of 10

Anonymous
Not applicable

I see I forgot to mention that I wanted to to this in an iLogic rule :S sorry..

 

You know how to do this?

 

If "something" Then

         Make line into construction line

    Else

         Make line into normal line

End If

0 Likes
Message 4 of 10

Cadmanto
Mentor
Mentor

Yeah, that's pretty key.  Smiley Happy

I am no iLogic guru, but here is a link that might help you get what you are looking for.

https://forums.autodesk.com/t5/inventor-forum/help-with-view-label-ilogic-rule/td-p/5001126

 

check.PNGIf this solved your issue please mark this posting "Accept as Solution".

Or if you like something that was said and it was helpful, Kudoskudos.PNG are appreciated. Thanks!!!! Smiley Very Happy

 

New EE Logo.PNG

Inventor.PNG     vault.PNG

Best Regards,
Scott McFadden
(Colossians 3:23-25)


0 Likes
Message 5 of 10

llorden4
Collaborator
Collaborator

A little late to the party but I had the same question and finally found a solution.  Posting for anyone else that might have the question.

 

Basically, a parameter subset of your variable you assign a boolean value to, False being default.

 

oTop = oSketch.AddByProjectingEntity("YourProjectedEntityHere")															'project Top side
	oTop.Construction = True
[Or]
oLine = oSketch.SkethLines.AddByTwoPoints(oPt1, oPt2)
oLine.Construction = True


 

Autodesk Inventor Certified Professional
0 Likes
Message 6 of 10

blaroseLB2EQ
Participant
Participant
Hi! I understand what you are trying to do and i found this https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=SketchLine_Construction
to express how to set a line as construction. But i don't understand how to get the line. How can i write it ? Where do I know which line to get ?
0 Likes
Message 7 of 10

llorden4
Collaborator
Collaborator

It'll be up to you to either manage all the lines (entities actually) within a sketch or search through all the entities within the sketch to identify the specific line you are wanting to edit.  You'll need to know something about the entity you're looking for in order to identify it.  It could be a point that's located on a plane, you may already know a start or stop point, there's any number of ways to search for location or features, but you must know something about the line or allow the user to select the line to identify it for you.

 

Once you have the specific entity identified, you assign that entity to a variable name to make it easier to manage since making a modification to that entity could alter the Inventor variable you just found it as.  In the case of my previous example, I assigned the line to the variable "oLine" which was my way of referencing that entity to modify it.

 

True I only showed a very small snippet of that code, assuming you knew a bit about coding already.  It would appear there's still a bit of learning going on here so I'll include more code that would at least allow you to run the example...

 

'declare how variable names will be used as
Dim oDoc As PartDocument = ThisDoc.Document
Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oSketch As PlanarSketch
Dim oWorkPlane As WorkPlane
Dim oLine As SketchLine
Dim oPt1, oPt2 As Point2d

For Each oSketch In oCompDef.Sketches					'delete any previous test sketch
	If oSketch.Name = "Test Sketch" Then oSketch.Delete
Next

'Create a sketch
oWorkPlane = oCompDef.WorkPlanes.Item("XY Plane")		'assign XY Plane to oWorkplane variable
oSketch = oCompDef.Sketches.Add(oWorkPlane)				'assign oSketch as the variable for this new sketch
oSketch.Name = "Test Sketch"							'Assign Model Tree name to this scketch
oGC = oSketch.GeometricConstraints						'variable name shortcut for Sketch Constraints
oPt1 = oTG.CreatePoint2d(0, 0)							'identify location for first point variable
oPt2 = oTG.CreatePoint2d(5, -12)						'identify location for second point variable
oLine = oSketch.SketchLines.AddByTwoPoints(oPt1, oPt2)	'create a new line and reference it as the variable "oLine"
oLine.Construction = True	

 

Hope this helps.

Autodesk Inventor Certified Professional
0 Likes
Message 8 of 10

blaroseLB2EQ
Participant
Participant
Thank you for the quick reply! I tried your example and indeed it works (and I understood it!). The thing is that my line and sketch are already created and the line I want to altern between construction and normal is always moving so the start point is never the same.
0 Likes
Message 9 of 10

Hochenauer
Autodesk
Autodesk

In that case you need to translate:

 

"The line I want to edit" into something that programming logic can express. For example: Is the sketch geometry stable (always change the 3rd line in the sketch), or the middle line of 3 connected ones, ....

 

Is user interaction with your logic an option (pick it)?

 

Without really knowing what your inputs are and what you are trying to accomplish by changing to construction it's hard to give a more useful answer.

Thanks,

Gerald

 

 



Gerald Hochenauer
Senior Principal Engineer, Inventor
Autodesk, Inc.

0 Likes
Message 10 of 10

blaroseLB2EQ
Participant
Participant
Hi Gerald,
I created another topic explaining what I mostly want to do: https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/non-uniformed-pattern-with-parameter...
You are right, I don't mind having user interaction, because it is a complicated part and it is changing eveytime we do this kind of mandate.
0 Likes