Registrujte se na 22. ročník konference CADfórum 2025 - 30.9. Zámek Valeč.
Přes 118.500 registrovaných u nás, celkem 1.096.000 registrovaných (CZ+EN), přes 53.000 CAD/BIM bloků.
Vyzkoušejte nový přesný Inženýrský kalkulátor a aktualizovaný Generátor čarových kódů.
CAD tip # 11204:
Otázka
A
Pomocí následujícího makra iLogic můžete snadno změnit rozměrové jednotky ve všech součástech aktuální sestavy Inventoru - např. na mm a gramy:
question = MessageBox.Show("Opravdu chcete změnit jednotky v celé sestavě?", "iLogic", MessageBoxButtons.YesNo) if question = vbYes then ' přednastavené jednotky oUOM1 = UnitsTypeEnum.kMillimeterLengthUnits ' nebo UnitsTypeEnum.kCentimeterLengthUnits oUOM2 = UnitsTypeEnum.kGramMassUnits ' nebo UnitsTypeEnum.kKilogramMassUnits oPrecision = 3 dim openDoc as document openDoc = ThisDoc.Document openDoc.unitsofmeasure.LengthUnits = oUOM1 openDoc.unitsofmeasure.MassUnits = oUOM2 openDoc.unitsofmeasure.LengthDisplayPrecision = oPrecision dim docFile as document For Each docFile In openDoc.AllReferencedDocuments ' jen součásti If docFile.DocumentType = kPartDocumentObject Then dim FNamePos as long FNamePos = InStrRev(docFile.FullFileName, "\", -1) dim docFName as string docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos) docFile.unitsofmeasure.LengthUnits = oUOM1 docFile.unitsofmeasure.MassUnits = oUOM2 docFile.unitsofmeasure.LengthDisplayPrecision = oPrecision docFile.Rebuild End If Next iLogicVb.UpdateWhenDone = True end if
platí pro: Inventor ·