Ilogic Model State Drawing views

Ilogic Model State Drawing views

andrew_canfield
Collaborator Collaborator
3,248 Views
20 Replies
Message 1 of 21

Ilogic Model State Drawing views

andrew_canfield
Collaborator
Collaborator

Hello 

 

I have a iLogic driven sketch which moves sub assemblies.

I'd like to have a drawing show the assembly in different positions (as driven by iLogic).

Wondering what approach to take, creating a new Model State at the top level doesn't work for the drawing views, which will change when the top level changes are updated (even when the Model State & View Rep is set).

 

First venture into iLogic & Model States.

 

Regards

 

Andrew

0 Likes
Accepted solutions (1)
3,249 Views
20 Replies
Replies (20)
Message 2 of 21

Frederick_Law
Mentor
Mentor

Depends on how your iLogic rule works.

I usually use Pos Rep.

0 Likes
Message 3 of 21

andrew_canfield
Collaborator
Collaborator

Thanks for the reply.

The idea is to use value sliders to position & then save as a model state - like Positional Reps without drilling through all the constraints - so far there's only 3 parameters to write back. 3 for Model State 1, then 3 for Model State 2 etc.

Not as easy as first thought..

 

Regards

 

Andrew

0 Likes
Message 4 of 21

J-Camper
Advisor
Advisor

Do you mean:

 

  1. the drawing view changes by model state selection? 
  2. a drawing view showing all the modelstates?

 

If 1, then you should be able to just change the modelstate of the main assembly, after setting up the different modelstates within the assembly.  This could be manual, or you can use the ".SetActiveModelState" Method under the DrawingView Object.

         If you are trying to make modelstates of the assembly from the Drawing file, that would be much more complex

 

If 2, then I think you could just use overlay views.  You can set each overlay to a different model state and DesignView, if needed. Again, only if you are setting the ModelStates in your main assembly before hand.  Creating the ModelStates From the Drawing level would be more complicated.

 

If neither, please elaborate.

 

If you are trying to make/set modelstates from the drawing file, that will require more research, as I have not done so myself. 

Message 5 of 21

Frederick_Law
Mentor
Mentor

@andrew_canfield wrote:

Thanks for the reply.

The idea is to use value sliders to position & then save as a model state - like Positional Reps without drilling through all the constraints - so far there's only 3 parameters to write back. 3 for Model State 1, then 3 for Model State 2 etc.

Not as easy as first thought..

 

Regards

 

Andrew


I usually rename the constrains I need to change and drag them to the top of the list.

I know Overlay View works with PosRep, don't know if it works with MS.

0 Likes
Message 6 of 21

andrew_canfield
Collaborator
Collaborator

Apologies, not really an iLogic problem, just didn't realise how Model States work. 

When a model state is set in the skeleton The top level needs to call the same model state.

I was moving the skeleton then creating a model state, moving the skeleton & creating another model state - which doesn't work.

Possibly need to link the Top level parameter ilogic slider to the skeleton & then create model states in the skeleton and the top level with the same name - think there's a dialog to do this which would be nice to have, not essential.

It's not 100% finished but so far very cool 🙂

Thanks for the replies.

 

Andrew

0 Likes
Message 7 of 21

WCrihfield
Mentor
Mentor

Just so you know, on the Assemble tab, is a panel called Productivity (may be hidden).  The tool within it is usually a drop-down button, with many other buttons within it.  One of those buttons within is 'Link Model States'.  You may be able to use that.  But I do not do much 'skeletal' modeling, so I'm not sure how well it would work out for you.

https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-D1CED5D8-F043-4555-BBA5-2C6029AF819F 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 8 of 21

A.Acheson
Mentor
Mentor
Accepted solution

Hi @andrew_canfield 

Here is a post on the inventor forum where it is determined that skeleton modelling  technique is not supported.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 9 of 21

andrew_canfield
Collaborator
Collaborator

Many thanks for the link, it's a good post.

 

Regards

 

Andrew

0 Likes
Message 10 of 21

andrew_canfield
Collaborator
Collaborator

 

The skeletal model was ok  - thought setting model states in the sketch would would but a secondary part is derived & the drop down show the model states but this doesn't update - not sure if ilogic can drive this selection, it's already looking a bit complicated.. but it nearly works.

 

DerivedModel State.JPG

0 Likes
Message 11 of 21

Frederick_Law
Mentor
Mentor

Model State is still in development.

Next update might break what you're doing or make it better.

0 Likes
Message 12 of 21

andrew_canfield
Collaborator
Collaborator

The original intention was to position an assembly with ilogic value sliders linked to a skeletal part then take a snap shot (model state 1,2,3) but it's a non starter. Alternatively a UCS could be placed at the top level & the parameter linked back to the Skeletal model - snap shots then recorded as positional reps, but the Positional Rep value doesn't appear in the parameter table. (The UCS parameters driving position for the lower level skeleton)

From digging around this does look 'doable' (?) -  the skeleton being repositioned for each PR - renaming each PR to include the co-ordinates then pass the PR name down the line.

Can the PR name be read as a string for iLogic the extract x,y,z values?

0 Likes
Message 13 of 21

Frederick_Law
Mentor
Mentor

Model State in assembly can only "remember" parameters in that assembly.

It cannot affect or change another part or assembly.

So it cannot change "Skeleton".

It can use another Model State form the "Skeleton".

 

The problem is, skeleton control EVERY files using the skeleton.

 

You need to rethink how and what you need to control from where.

 

Again, I would not use Skeleton to control Position.

Position is constrain driven.

Skeleton control part size, shape.  Location is a side effect.

0 Likes
Message 14 of 21

andrew_canfield
Collaborator
Collaborator

CableGuide.JPG

In summary - the only way to show something like the above (simplified as a part) in multiple positions on a drawing is to use Model States & Positional Reps for positions 1m, 1.5m, 2.0m  - even though a skeletal representation will show any position along the range it will only show one on a drawing. 

Thanks for the help.

Message 15 of 21

Frederick_Law
Mentor
Mentor

If you setup contacts and limits on each link, it can be flexible and move in the assembly.

Assemble longest one you need.

Model State short one by suppressing extra links and "add" unsuppress end link.

Don't know if iMate can do limit and contact.  It will simplify assembling.

Message 16 of 21

timothy_berg
Advocate
Advocate

What would option 1 look like? I want to set the Model State in the model and have the drawing views follow the active Model State.

0 Likes
Message 17 of 21

WCrihfield
Mentor
Mentor

Hi @timothy_berg.  It sounds like you want to be able to switch between multiple available ModelStates that are defined within your model, and have that action automatically change which ModelState a drawing view representing this model is set to.  There is no natural / normal way do make that happen.  However, it may be possible to make happen through the use of one or more iLogic rules and either the Event Triggers dialog, or one or more custom event handler codes, that would control when those rules run, based on when specific events happen.  Then, the 'event' would happen on the model side, but the model does not know about any drawing that may exist for that model, so the code would have to include a way to find the drawing, one way or another.  Then once it finds the drawing, it would have to find the correct sheet within that drawing, and he correct drawing view(s) in that drawing to check/update.  Then it would have to change which ModelState that view was set to.  In newer versions of Inventor, when working within either a part or assembly, there is an event within the 'This Document' tab of the Event Triggers dialog named 'Model State Activated'.  The iLogic rule could be placed under that event in the model file.  Then when you activate a ModelState in that model, it will trigger that iLogic rule to run.  Then that iLogic rule will have to check which ModelState is currently active, then find the drawing, sheets(s), view(s), and change the view to that ModelState.  At least that would be the theoretical plan.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 18 of 21

timothy_berg
Advocate
Advocate

Thanks, Wesley. I was able to get the Model State name from the mode into a custom iProperty in the drawing, is there a way to set the view Model State to match the custom iProperty?

 

Rule in Model:

MODELSTATENAME=ThisDoc.ActiveModelState
iProperties.Value("Project", "Cost Center")=MODELSTATENAME
Rule in Drawing:
If
ThisDrawing.Document Is ThisApplication.ActiveDocument AndAlso ThisDrawing.ModelDocument IsNot Nothing Then 'get the document object of the base model for this drawing Dim mDoc As Inventor.Document = ThisDrawing.ModelDocument 'get the PropertySet containing the default Description iProperty Dim props As PropertySet = mDoc.PropertySets.Item("Design Tracking Properties") 'pull the values of the base model's Description into the drawing's custom iProperty 'DESCRIPTION' iProperties.Value("Custom", "DESCRIPTION") = props.Item("Description").Value.ToString iProperties.Value("Custom", "MODELSTATENAME") = props.Item("COST CENTER").Value.ToString 'force an update to refresh the title block ThisDrawing.Document.Update2(True) End If

 

0 Likes
Message 19 of 21

Frederick_Law
Mentor
Mentor

The "usual" way is 1 drawing for each ModelState.

What are you trying to do?

 

To update drawing to another ModelState, you can change ModelState in each view.

This go through each View in ActiveSheet:

Dim oIDWFile As DrawingDocument
Dim oDrawingView As DrawingView
Dim oMSName As String

For Each oDrawingView In oIDWFile.ActiveSheet.DrawingViews
	If oDrawingView.ActiveModelState <> oMSName Then
		Logger.Info(oDrawingView.Label.Text & " " & oDrawingView.ActiveModelState)
		oDrawingView.SetActiveModelState(oMSName, True, True)
	End If
Next

 

0 Likes
Message 20 of 21

timothy_berg
Advocate
Advocate

The end goal is to link the model state views in the drawing to the active model state in the model.

0 Likes