iLogic, Inventor .ipt, .idw

iLogic, Inventor .ipt, .idw

Anonymous
Not applicable
1,056 Views
11 Replies
Message 1 of 12

iLogic, Inventor .ipt, .idw

Anonymous
Not applicable

Hi All 🙂

I have this problem, i need to write a rule in inventor for enable the right drawing(.idw) for the right type of "Option" in model.


E.g. when I select Option "Dimpled"
Dimpled.PNG

 Only "Dimpled" sheet in drawing window Should be enabled(Active)

Dimpled drawing.PNG

When I select "Fishbone" in Model(.ipt), enable "Fishbone" in Drawing(.drw) , etc. etc.

 

I think  i need to write a code in model somehow

SyntaxEditor Code Snippet

Select Case (TextureType)
	Case "Dimpled"
...???

 But what next? I hope i made myself clear.

 

Thank you very much

Pavol

0 Likes
Accepted solutions (1)
1,057 Views
11 Replies
Replies (11)
Message 2 of 12

marcin_otręba
Advisor
Advisor
Select Case (TextureType)
	Case "Dimpled"
ActiveSheet = ThisDrawing.Sheet("dimpled:3")

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 3 of 12

Anonymous
Not applicable

Thank you very much.
It works, but it seeems, the rest of the sheets are still enable to select.
Is it somehow possible to disable them completely?
Sorry for primitive questions, i am very new.


Thanks again

0 Likes
Message 4 of 12

marcin_otręba
Advisor
Advisor

Use this one:


Dim osheet As sheet
For Each osheet In ThisDrawing.Document.sheets
If Left(osheet.Name,Len(TextureType))=TextureType
ActiveSheet = ThisDrawing.Sheet(osheet.Name)
Else
osheet.delete
End If
Next

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 5 of 12

Anonymous
Not applicable

I must be doing something worng, but it does not work. All of the sheets are  over-written  everytime I change the Type in model and none of the sheets are disabled.
Was I suppose to put it to Ilogic of drawing or Model?

 

BR

0 Likes
Message 6 of 12

marcin_otręba
Advisor
Advisor

if you want to use it in your form you must change thisdrawing to your variable.

If you want to use it in drawing then you must retrive TextureType variable.

What's more in my loop sheets that will not have correct name (depending from choice) will be deleted from drawing... i don't understand what you mean saying by "disable" sheet.

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 7 of 12

marcin_otręba
Advisor
Advisor

Could you provide your code ? can be via private message...I will take a look at it.

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 8 of 12

Anonymous
Not applicable

Attached is the description of my problem.
Please, try to look at it, if there is something you do not understand, let me know.

Thanks a lot

0 Likes
Message 9 of 12

marcin_otręba
Advisor
Advisor

well.. you shoul use first code then:

 

Select Case (TextureType)
	Case "Dimpled"
ActiveSheet = ThisDrawing.Sheet("dimpled:3")

what's about updating you can update only views which are on that particular sheet. you can also set representation of model in sheet (view representation) and set as  associated (view).

You can disable printing rest of sheets. But you can't lock it or disable it.

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 10 of 12

Anonymous
Not applicable

I decided to create 6 separate drawings, one for each type.
Save them in a folder and now i need to add button "Create Drawing"with code that opens the exact drawing when i am done with specification.
Hope its gonna work.
Maybe If you have some idea how the code should look like, it would help me a lot.

Anyway, thank you very much for your help!!!

0 Likes
Message 11 of 12

marcin_otręba
Advisor
Advisor
Accepted solution

if drawings are created in the same folder and with the same name just type:

Dim doc As Document
doc = ThisApplication.ActiveDocument
ThisApplication.Documents.Open Left(doc.FullFileName, Len(doc.FullFileName) - 4) & TextureType & ".idw"

 

you must provide texturetype.

It assumes that drawing is named: documentname+Texturetype without any other chars...

If you made it differently you need to give me some rules for naming etc.

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 12 of 12

Anonymous
Not applicable

Thank you very much 🙂

It works now, i had to download debug view so I could see the right path and i needed to get more characters gone, so my code looks like this now:


SyntaxEditor Code Snippet

Dim doc As Document
doc = ThisApplication.ActiveDocument
Dim path As String
path = Left(doc.FullFileName, Len(doc.FullFileName) - 21) & TextureType & ".idw"
ThisApplication.Documents.Open(path)

Trace.WriteLine(path)


Thanks again!


 

0 Likes