Thursday, 17 July 2014

Happiness is...

I received the call yesterday to say that we have been granted a permanent residency Visa for Australia.

I am still in shock, as we have been waiting so long now, finally the axe over our heads has been removed and we can now start our lives again.

☺ ☺ ☺ ☺

Wednesday, 9 July 2014

iLogic Code to create Cusom Parameters

This little piece of code was created to bulk create custom parameters.

When I start with a new project, I sometimes need to create a lot of parameters in the skeleton part/s. This can sometimes be rather time consuming, so I wrote this snippet.

'GDI iLogic to create a new User Parameter
Sub Main()
Dim oNewParam as String
Dim oPartDoc as PartDocument = ThisDoc.Document

'Get the new Parameter Name
    tNewParam = InputBox("Input Name for New Parameter" & vbNewLine & "" & vbNewLine & "add '-DEG' for Angle" & vbNewLine & "E.G: xxx-DEG", "GDI - iLogic", "") ' prompt the user for a parameter name

If tNewParam <>"" Then 'Error Check if user presses the Cancel key
'Split the name If Needed
    oNewParam = Split(tNewParam, "-") (0)

 'Check for the new parameter name
 'If found then Exit to the question of create something else.
    Try
        oParam = oPartDoc.ComponentDefinition.Parameters(oNewParam)
        i1 = MessageBox.Show(oNewParam & vbNewLine & "Parameter already exists", "GDI - iLogic", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
        Call AsktoCreateAnother ' Subroutine to create another
      
        Catch     'If the parameter was not found, then create a new one.
            If tNewParam.contains ("deg") Or tNewParam.contains ("DEG")Then 'Checks the Temp name, inputted by user
                Call DegreeSUB (oNewParam) 'Pass the Variable name to the sub
            Else
                Call mmSUB (oNewParam) 'Pass the Variable name to the sub
            'Return
            End If
        End Try
    Else 'this one comes from the cancel key press
    MessageBox.Show("Cancel key pressed", "GDI - iLogic")
    Return 'exit the code if Cancel is pressed.
    End If
End Sub

Sub DegreeSUB (ByRef oNewParam as String)
Dim oPartDoc as PartDocument = ThisDoc.Document
Dim userParams As UserParameters = oPartDoc.ComponentDefinition.Parameters.UserParameters

oValue=InputBox("Add a Value?", "GDI - iLogic", 0) ' Get a Value if desired
oComment=InputBox("Add a description if desired?", "GDI - iLogic", "") ' Get a description if desired
    Dim newParam As UserParameter ' Placeholder
    Dim oFormat As CustomPropertyFormat
    newParam = userParams.AddByExpression(oNewParam, oValue, "deg") ' Create the Parameter as per above
    newParam.ExposedAsProperty=True 'Flag for Export
    oFormat=newParam.CustomPropertyFormat 'For some reason or other this line is needed to enable the following formatting
    oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
            oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.koneDecimalPlacePrecision 'Set one decimal place
            'oFormat.Units="mm" 'Units
            oFormat.ShowUnitsString=False
            oFormat.ShowLeadingZeros=False
            oFormat.ShowTrailingZeros=False
    newParam.comment=oComment 'Set the Description
    Call AsktoCreateAnother (oNewParam, oComment) ' Subroutine to add another
End Sub

Sub mmSUB (ByRef oNewParam as String)
Dim oPartDoc as PartDocument = ThisDoc.Document
Dim userParams As UserParameters = oPartDoc.ComponentDefinition.Parameters.UserParameters

oValue=InputBox("Add a Value?", "GDI - iLogic", 0) ' Get a Value if desired
oComment=InputBox("Add a description if desired?", "GDI - iLogic", "") ' Get a description if desired
    Dim newParam As UserParameter ' Placeholder
    Dim oFormat As CustomPropertyFormat
    newParam = userParams.AddByExpression(oNewParam, oValue, "mm") ' Create the Parameter as per above
    newParam.ExposedAsProperty=True 'Flag for Export
    oFormat=newParam.CustomPropertyFormat 'For some reason or other this line is needed to enable the following formatting
    oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
            oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.koneDecimalPlacePrecision 'Set one decimal place
            'oFormat.Units="mm" 'Units
            oFormat.ShowUnitsString=False
            oFormat.ShowLeadingZeros=False
            oFormat.ShowTrailingZeros=False
    newParam.comment=oComment 'Set the Description
    Call AsktoCreateAnother (oNewParam, oComment) ' Subroutine to add another
End Sub

Sub AsktoCreateAnother (ByRef oNewParam as String, ByRef oComment As String)
    i2 = MessageBox.Show(oNewparam & " (" & oComment & ")" & " - Created" & vbNewLine & "Add Another", "GDI - iLogic", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
    If i2 = "6" Then
    Main 'Got to the begining
    ElseIf i2 = "7" Then
    'Return
    End If
    Return
End Sub

Sub DONEAsktoCreateAnother
    i3 = MessageBox.Show("Add Another", "GDI - iLogic", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
    If i3 = "6" Then
    Main 'Got to the beginning
    ElseIf i3 = "7" Then
    'Return
    End If
    Return
End Sub

Wednesday, 2 July 2014

iLogic - Transfer a variable to a Sub routine

I discovered this one today, as I wanted a nice clean script, but I just could not pass a variable between my Sub Routines within iLogic.

I am pretty pleased with this, and will now try and make use of in other scripts.

Sub Main()
Dim oNewParam as String
Blah blah ... stuff in the script
Call NextSubRoutine (oNewParam)  'This is the important stuff - The bit in the brackets.
End Sub

Sub NextSubRoutine (ByRef oNewParam as String)  'NOTE: The bit in the brackets.
MessageBox.Show(oNewParam, "Variable transferred from the Main Sub")
blah blah ... stuff in the script
End Sub

Friday, 30 May 2014

Place Two Different Parts Lists on one Drawing

A question was raised on the Autodesk forum the other day on how to place the two different types of "Parts List" on one drawing

I thought I would make a quick video of the process.

Link to the original post:

http://forums.autodesk.com/t5/Inventor-General/Parts-list-BOM-views/m-p/4984744#M506048

Hope this helps :-)


Lines in the view are stretched after conversion to AutoCAD DWG

Lines in the view are stretched after conversion to AutoCAD DWG

This is something that comes up after every release of Inventor  and I thought I would post the link to the fix here:

http://beinginventive.typepad.com/being-inventive/2013/01/lines-in-the-view-are-stretched-after-conversion-to-autocad-dwg.html

The biggest issue is the spline creation.

  •  Edit the  .INI file created for exporting the Inventor files to AutoCAD I have a customized file as well as a customized Template.
  •  Find the line "REPLACE SPLINE=No", change the No with Yes and save the file

 My Customized ini file:


[EXPORT SELECT OPTIONS]
AUTOCAD VERSION=AutoCAD 2010
CREATE AUTOCAD MECHANICAL=No
USE TRANSMITTAL=No
USE CUSTOMIZE=No
CUSTOMIZE FILE=C:\Users\Public\Documents\Autodesk\Inventor 2012\Design Data\DWG-DXF\FlatPattern.xml
CREATE LAYER GROUP=No
PARTS ONLY=No
REPLACE SPLINE=Yes
CHORD TOLERANCE=0.001000
[EXPORT PROPERTIES]
SELECTED PROPERTIES=
[EXPORT DESTINATION]
SPACE=Model
SCALING=Text
ALL SHEETS=Yes
MAPPING=MapsBest
MODEL GEOMETRY ONLY=No
EXPLODE DIMENSIONS=No
SYMBOLS ARE BLOCKED=Yes
AUTOCAD TEMPLATE=C:\DATA\TEMPLATES\Standard.dwg
DESTINATION DXF=No
USE ACI FOR ENTITIES AND LAYERS=Yes
[EXPORT LINE TYPE & LINE SCALE]
LINE TYPE FILE=C:\Users\Public\Documents\Autodesk\Inventor 2012\COMPATIBILITY\Support\invISO.lin
Continuous=Continuous;0.
Dashed=DASHED;0.
Dashed Space=DASHED_SPACE;0.
Long Dash Dotted=LONG_DASH_DOTTED;0.
Long Dash Double Dot=LONG_DASH_DOUBLE_DOT;0.
Long Dash Triple Dot=LONG_DASH_TRIPLE_DOT;0.
Dotted=DOTTED;0.
Chain=CHAIN;0.
Double Dash Chain=DOUBLE_DASH_CHAIN;0.
Dash Double Dot=DASH_DOUBLE_DOT;0.
Dash Dot=DASH_DOT;0.
Double Dash Dot=DOUBLE_DASH_DOT;0.
Double Dash Double Dot=DOUBLE_DASH_DOUBLE_DOT;0.
Dash Triple Dot=DASH_TRIPLE_DOT;0.
Double Dash Triple Dot=DOUBLE_DASH_TRIPLE_DOT;0.

Thursday, 21 March 2013

Aaaargh !!!!

I have just re-installed my work computer, a two day affair I might add. I am not complaining, it was taking me long and longer to boot my computer, average time from Logon to being able to use the machine was 7 - 10 minutes. absolute madness.

Anyway the reason for the post, it too me forever to get the Inventor SDK working, I thought I would put it here, because I struggled to find support on the web.

Note, The registry info has been extracted from the Autodesk Forums.

1 - DISABLE ANTIVURUS
2 - Perform the following registry change:

RUN Regedit.exe
Drill down to HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk
Right click on the folder and click PERMISSIONS...
Click the Advanced Button
Click the Owner Tab
Click the Change owner to: Administrators (your workstations name) and
Check mark the Replace owner on subcontainers and objects.
Click Apply
Click the Permissions Tab and double check that the Administrators have Full Control for This key and subkeys.
Click OK , Click OK , Close Regedit
Restart the computer.


3 - Install the "User Tools" SDK
(C:\Users\Public\Documents\Autodesk\Inventor \SDK)

Select the "Just Me" option
Run everything as "Administrator"

4 - run the "RegisterDrawingTools.exe"


This worked for me.

Monday, 23 July 2012

Application form to take Isabella on a date!


AANSOEKVORM VIR TOESTEMMING OM MY DOGTER TE MAG UITVRA
Lees asseblief die volgende instruksies aandagtig deur voordat die vorm
ingevul word.Alle aansoeke moet vergesel word van 5kg (of meer) biltong, 12 bottels
KWV Roodeberg, 12 bottels KWV 10 jaar Brandewyn, en 1 kas Heineken.
Hierdie aansoek sal as onvolledig beskou word (en afgekeur word) indien
enige van die volgende NIE aangeheg is nie:
• Volledige finansiĆ«le state vir die laaste drie jaar
•Skool- en universiteitsgeskiedenis
• Werkgeskiedenis
• Familiegeskiedenis vir die laaste 200 jaar (Anglo-Boereoorlog Hensoppers,
joiners of Vermyders kan maar hier stop).
• Bestuurderslisensiegeskiedenis
• Volledige mediese ondersoek onderteken deur ‘n goedgekeurde dokter en
psigiater.
AANSOEKVORM
Naam: ____________________________________________________
Bynaam: ___________________________________________________
(Enige dierename of implementname soos saag, hamer, spyker, boor ens by
bogenoemde sal tot afkeuring lei)
Geboortedatum: _______________ Lengte: ______________
Gewig: ___________ IK:________________________
Skoolgemiddeld: ____________ ID #: _________________________
Bestuurderslisensie #: _________________
Tuisadres: ________________________________________________________________
Dorp/Stad : _________________ Kode: _________________
Het jy EEN manlike en EEN vroulike ouer? __________________________
Indien NEE, verduidelik __________________________________________
Aantal jare wat hulle getroud is: ___________________________________
Indien korter as jou ouderdom, verduidelik: __________________________
Besit jy:
‘n Kombi: J/N Ford Sierra: J/N
Enige ander kar met ‘n drukvin en allooiwiele wat NIE standaard is nie? J/N
‘n Waterbed: J/N ‘n Bakkie met ‘n matras agterin: J/N
Kondome: J/N Pornografie J/N
Dra jy ‘n oorbel, neusring of naeltjiering of enige ander ring? J/N
Het jy ‘n tatoeĆ«rmerk? J/N
INDIEN ANTWOORDE OP ENIGE VAN DIE BOONSTE VRAE JA IS, MOENIE VOORTGAAN
NIE EN VERLAAT DIE PERSEEL ONMIDDELLIK.
GEBRUIK EKSTRA PAPIER VIR DIE VOLGENDE VRAE
In 50 woorde of minder, wat beteken LAAT vir jou?
In 50 woorde of minder, wat beteken: MOENIE AAN MY DOGTER RAAK NIE?
In 50 woorde of minder, wat verstaan jy onder GEHEELONTHOUDING?
In nie MINDER as 5000 woorde nie, verduidelik wat jy verstaan onder die woord
VRY?
In 10 woorde of minder, wat verstaan jy onder die volgende:
KASTREER: ____________________________________________________
GENADEDOOD: __________________________________________________
Naam en adres van die kerk wat jy bywoon: __________________________
Hoe gereeld woon jy kerk by?___________________________
Wanneer sal die beste tyd wees om die volgende persone te ondervra:
Vader: __________________ Predikant: ____________________
Moeder: ______________ Paroolbeampte: ________________
Sal jou ouers hulle vrywillig aan genetiese toetsing onderwerp of sal
doofpyle gebruik moet word? ___________
Enige besware teen die deursoeking van jou persoon, voertuig, hok of gat of
enige ander blyplek? ___________
Voltooi die volgende sinne. Antwoorde sal as vertroulik beskou word.
a. Indien ek geslaan word, wil ek baie graag NIE die volgende been gebreek
wil he nie: ________________________________________
b. Indien ek raakgeskiet word, sou ek nie raakgeskiet wou word op
my:______________________________________________
c. ‘n Vrou se plek is in die: ______________________________________
d. Die een ding wat ek hoop NIE gevra sal word in die onderhoud nie,is:
___________________________________________________
e. Wanneer ek ‘n meisie vir die eerste keer ontmoet, sien ek heel eerste
die volgende raak:____________________
NOTA: Indien enige antwoord as verlangs as vulger beskou sou kon word, stop dadelik.
Terwyl jy die perseel verlaat, hardloop in S’e en hou jou kop laag.
Wat wil jy word INDIEN jy moontlik groot word?___________________________
Wat is die huidige tariewe van ‘n hotelkamer?_____________________________
Hoe weet jy dit? _____________________________________________________
Aan watter sport dink jy as jy die woorde hoor “First Base” en “Second
Base”?______________________________
HIERMEE BELOOF EK PLEGTIG DAT AL DIE BOGENOEMDE INLIGTING KORREK EN
WAAR IS. VERKEERDELIK VERSKAFDE INLIGTING MAG LEI TOT DIE DOOD,
ONTMANNING, DIEVERLOOR VAN LEDEMATE, ROOIMIER-MARTELING, KRUISIGING,
ELEKTRIESE SKOK, CHINESE WATERMARTELING EN ROOIWARM YSTERTOEDIENING.
HANDTEKENING (dis jou naam): __________________________________________
Dankie vir jou belangstelling. Laat asseblief 4 tot 6 jaar toe vir
prosessering. Jy sal skriftelik in kennis gestel word indien jou aansoek
aanvaar word. Moet asseblief nie probeer om telefonies, elektronies,
skriftelik, per posduif, vingertaal of deur middel van rookseine in
verbinding te tree nie (aangesien dit tot ernstige beserings kan lei).
Indien jou aansoek afgekeur word, sal ek en my slagter jou persoonlik kom in
kennis stel…