AutoCAD Inventor :: ILogic Code To Turn Sketch Block Visibility On And Off
Jul 28, 2013
I've managed to cobble this code together to turn some sketch visibilities on and off. However, what I'd really like to do is have a single sketch containing some blocks, and turn the visibility of the blocks on and off... How to call the blocks -
'Iterate through the sketches collection'Turn the edging indicators On And Off
For Each oSketch In oDoc.ComponentDefinition.Sketches Select Case
oSketch.NameCase "Front Edged"If E01 = True Then
oSketch.Visible = TrueElse oSketch.Visible = FalseEnd IfCase "Top Edged"If E02 = True Then
oSketch.Visible = TrueElse oSketch.Visible = FalseEnd IfCase "Back Edged"If E03 = True Then
oSketch.Visible = TrueElse oSketch.Visible = FalseEnd IfCase "Base Edged"If E04 = True Then
oSketch.Visible = TrueElse oSketch.Visible = FalseEnd IfEnd SelectNext
I have three sketches. Two are 2D sketches and the third is a 3D sketch created by the intersection of two surfaces created from the previous two 2D sketches. The order of the browser is as follows:
Sketch1 Sketch2
Revolution (surface) Extrusion (surface)
3D Sketch 1
When I go back to edit Sketch 2, Sketch 1 is always showing...regardless of whether or not I turn on/off visibility. The visibility toggle has no effect. Sketch 2 has no projected geometry from Sketch 1.
At my company when producing drawings for manufacture we require a sheet for any steel profiles to be cut!..We do this by selecting the assembly from base view,hitting model view tab, selecting presentation and choosing the relevant profile from the drop down!
Once the profile is placed, we highlight the view and hit the parts list tab which obviously creates a parts list, but for the whole assembly, we then have to edit the parts list by turning off the visibility of the lines of all the parts which are not relevant!!...as you can imagine this is quite a laborious task if you have 50 different profiles.
The reason for this is to show the qty, steel grade and part number to the suppliers. My question is, any code that will take the lines of the parts list that are not relevant to the selected view and turn the visibility of those lines off?
I sometimes edit parts in assemblies. When I turn sketch visibility on or off it does not stay the way I left it. I should be able to edit a part in part view or assembly and the view setting off or on should be how it was last saved. If I saved an ipt with the vision it should be on in any & all assemblies it lives in but its not. I have noticed the difference in new version 2012 - 2011 was no problem.
The attached part has multiple holes in multiple locations...... I want to show in the .idw one set "row" around the circumference at a time.
So I want to show set one, how far in from the end of the tube, then how many and at what degrees around the 360*. to do this i can only suppress the other features right now.
so when I make another View those same parts are suppressed and i cant change it around otherwise it messes with the holes I want and don't want to show in the previous view.
Somehow my top level assembly shows the UCS triads for hundreads of my parts (but not all of them). I know I didn't turn the visibility of all these UCS triads on manually. Now I cannot get them to turn off.
When I toggle the visibility status of a few and save the file they come back when the file is reopened.
Note, they are NOT visibile in their respective part files, just in my top level assembly.
I added another extrusion profile to my structural shapes library, using the same method as the others a few years ago. It works, but the new extrusion now shows up with its profile sketch, start and end planes, and driven dimension visible. The old stuff doesn't (like I would expect). I have all planes in the published part turned off, not marked for export, etc., just like in the old ones. How do I turn this off? Inventor 2012 SP2.
When I open the extrusion separately, the work features to not display. But, the it's also shown as the "default" color not as material. Why does it default to "default" not "as material" like everything else?
I've noticed that one can turn off the visibility of an entire component pattern by manually right-clicking the pattern in the browser and unchecking "Visibility". However, when one tries to automate this process with the following code, only the first element of the pattern is made invisible.
Is there a better way to do this, or will I be forced to develop a "workaround" like first changing the number of elements to 1?
I've been desperately trying to find a way to "turn off" unneeded assembly components without iAssemblies or LOD's, but Inventor always finds a way to stop me. This workflow of turning off visibility and setting BOM status to "Reference" would work if only I can make patterns invisible, also.
In Inventor dwgs when I turn the visibility of the harness assembly off (the icon turns gray) the harness still remains visible in the View on the dwg. My co-worker is having the same problem. This is happening on several different inventor dwgs where the harness is not visible (the visibility is turned off) but once an edit is made to the assembly (such as making a part visible) the harness becomes visible even the the visibility is turned off in that View. I don't know if this is related to the recent installation of service pack 4 for inventor 2010 as this problem recently began occurring.
It happens sometimes, when I try to turn off the visibility of a part in a created view, the option is grayed out, can't uncheck visibility. Whats the reason?
I'm doing a fairly big one-off for use at our factory so am going the multibody ipt route. I have a design view setup within the ipt with nearly all solids switched off but when working within a sketch this seems to be ignored. I want to make sure I am projecting from sketches not bodies so if I need to tweak things later and bodies change the model won't fail.
I.e. the bodies all become visible when working in a sketch where as before going into the sketch the bodies weren't showing.
Is there a way to turn off visibility on work planes using ilogic? Also, is there a way to change an extrusion type from an assymetrical extrusion to a one direction extrusion using ilogic?
I have an assembly that was generated by Pro/E. It opens fine, but there are roughly 1000+ planes that are all visible. Is there a way to easily shut these all off whithout having to do it in each part?
I am looking for a way to log out of vault from within Inventor using iLogic codes. I have created an iLogic rule that automates export an assembly drawing and all sub component drawings. In my code, I have suppressed all Inventor prompts but I do not have a way to suppress Vault prompts. I can manually log off from vault and run this rule without any problems. However, if I forget to do so, I am stuck responding to update requests from vault and check out requests constantly for each and every file.
I recently created some iLogic based components. I wonder how difficult it is to protect the iLogic code, similar as VBA code which can be password protected.
The reason being:
1. Of course, to hide & protect the creator's modeling logic;
2. To avoid the relation between parameters being messed up by the end user unintensionally.
I did have the opportunity to raise the question during the Portathon event and the answer was that the protection not directly available, though the workaround could be mixing with some Inventor API coding in .NET.
However, this might defeat one of the benefits of iLogic, simple and ease to use, gentlr learning curve, especially for users with VBA experience. .NET might not be so easy for a lot of engineers from mechanical or other disciplines.
1 Disable the "Edit" button for iLogic components, including rules, forms, etc.;
2. Put all code that are to be protected in an external file, and then make that file unreadable (password protected, or other protection) to un-intended user, however, readable to those who have proper access privelege.
A while back I figured out how to put a few characters before and after several lines of code in iLogic to make it compress to one line or expand to its full size inside the code editor. I belive this is a fairly common VBA command, but I can't figure out how to do it again.
Inventor 2014 HP Pavilion dv6t-6b00 Intel Core i7 2670QM AMD Radeon HD 6490M 8gb RAM Windows 7 64 bit 3Dconnexion SpaceExplorer
How to close an application (*.ipt & *.iam) by ilogic code?I tried to use...ThisDoc.Document.close (True) to close it.Indeed, it can close the application, but there is an error occurred as following:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
how to avoid this error or any other way to close (or exit) the application?
I am trying to use a code window plugin on my website, and would like to create a temple for iLogic code. Is there any way to output iLogic code in a format that would work?
I cannot modify any of the existing templates because iLogic requires information as to whether to make some text brown or blue, and it would need some form of output to do that.
[URL]
The instruction page is here: [URL]
I have been manually highlighting or using images, but both have their problems. (cut & paste will lead to a pile of errors with the manual highlighting). I can create the css file, but need some form of output beyond cut & paste to work with.
If something is worked out, it will be added to the program and be available to everyone free (this is a Wordpress plugin).
[URL]
Self built computer with;
Quad core processor 16 gigs ram Raptor Raid main drives 2 x 1TB Caviar Black storage drives local 2 x 1TB Caviar Black storage drives network backup
Main Software; Product Design Suite Premium Windows 7 Home Premium [URL]
Since changing to Inventor I seem to be unable to turn off visibility of parts in assemblies on a drawing. Usually I just expand the view in the browser then right click on parts and turn off visibility. When I try this the visibility option is grey.
It's 2012. I haven't found a setting in the dim style or the RMB options to turn off the extension line. I saw the posts showing drawing a sketch in the view but come on, all that to just turn off the line?