Aide MicroStation CONNECT Edition

Types d'expression et exemples de syntaxe

Types d'expression et exemples de syntaxe

Ci-après figurent différents types d'expression et leurs exemples de syntaxe :
  • Symboles généraux (arithmétiques)
    • 1 + « 4 » renvoie la valeur 5
    • 2,3 * 3 renvoie la valeur 6,9
    • 12/5 renvoie la valeur 2,4
    • 12\5 renvoie la valeur 2
    • Exposant (^)
    • Modulo (%)
    • Égal à (==)
    • Différent de (!=)
    • Inférieur à (<)
    • Supérieur à (>)
    • Inférieur ou égal à (<=)
    • Supérieur ou égal à (>=)
    • Et (&&)
    • Ou (| |)
    • Pas (!) - annule une valeur Vrai ou Faux
  • Chaîne de concaténation
    • 1 & « 4 » renvoie la valeur « 14 »
    • « Tuyau » & « et » & « Vanne » renvoie la valeur « Tuyau et Vanne »
  • Symboles IIf (condition)
    • IIf (500>200, « math ok », « math wrong ») renvoie la valeur « math ok »
    • IIf (500<200, « math ok », « math wrong ») renvoie la valeur « math wrong »
  • Symbole IIf (comparaison)
    • 20<10 renvoie la valeur « false »
    • IIf(System.String.Compare (« Tuyau », « Tuyau »), « match », « no match ») renvoie la valeur « match »
  • System Math
    • System.Math.Abs (valeur)
    • System.Math.Acos (valeur)
    • System.Math.Asin (valeur)
    • System.Math.Atan (valeur)
    • System.Math.Atan2 (y,x)
    • System.Math.BigMul (a,b)
    • System.Math.Ceiling (a)
    • System.Math.Cos (r)
    • System.Math.Cosh (r)
    • System.Math.E
    • System.Math.Exp (p)
    • System.Math.Floor (d)
    • System.Math.IEEERemainder (x,y)
    • System.Math.Log (r)
    • System.Math.Log10 (d)
    • System.Math.Max (x,y)
    • System.Math.Min (x,y)
    • System.Math.PI
    • System.Math.Pow (x,y)
    • System.Math.Round (valeur)
    • System.Math.Sin(45*System.Math.PI/180)
    • System.Math.Sin(Double a)
    • System.Math.Sinh(a)
    • System.Math.Sqrt(Double d)
    • System.Math.Tan (a)
    • System.Math.Tanh (a)
    • System.Math.Round(4.53459)
    • System.Math.Log(1.2) / System.Math.Log(0,1)
    • System.Math.Max(1,2, 1,1)
  • Chemin système
    • System.Path.GetFileNameWithoutExtension("C:\ProgramData\Bentley\MicroStation CONNECT Edition\Configuration\Organization\Dgnlib\Gui\test.dgnlib") renvoie la valeur « test »
    • System.Path.GetExtension("C:\ProgramData\Bentley\MicroStation CONNECT Edition\Configuration\Organization\Dgnlib\Gui\test.dgnlib") renvoie la valeur « .dgnlib »
    • System.Path.Combine (path1,path2)
    • System.Path.GetDirectoryName (path)
    • System.Path.GetExtension (path)
    • System.Path.GetFileName (path)
    • System.Path.GetFileNameWithoutExtension (path)
    • System.Path.GetFullPath (path)
  • Chaîne système
    • System.String.Compare (string1,string2)
    • System.String.CompareI (string1,string2)
    • System.String.Contains(String string1, String string2)
    • System.String.Containsl(String string1, String string2)
    • System.String.Format (format,arg0)
    • System.String.IndexOf (search,find)
    • System.String.LastIndexOf (search,find)
    • System.String.Length(« Tuyau ») renvoie la valeur « 4 »
    • System.String.Substring (value,startIndex,length)
    • System.String.ToLower (value)
    • System.String.ToString (value)
    • System.String.ToUpper (value)
    • System.String.Trim (value)
  • Propriétés d'élément
    • this.GetElement().ElementID
    • this.GetElement().TotalLength
    • this.GetElement().ElementDescription
    • this.GetElement().Color
  • Remarque : Les syntaxes « this( » et « Column( » sont prises en charge pour conserver la rétrocompatibilité.
  • Propriétés de modèle
    • this.GetModel().Is3D
    • this.GetModel().Name
    • this.GetModel().Description
    • this.GetModel().Resolution
  • Propriétés du fichier
    • this.GetFile().Author
    • this.GetFile().Editor
    • this.GetFile().FileName
  • GetItemSameLibrary()
    • this.GetItem("Lib1Itp1").TextProp
    • this.GetItem("Lib1Itp1").IntegerProp
    • this.GetItem("Lib1Itp1").DoubleProp
    • this.GetItem("Lib1Itp1").ArrayProp[0] & " \" & this.GetItem("Lib1Itp1").ArrayProp[1]
  • GetItemDifferentLibrary()
    • this.GetItem("Lib1:Lib1Itp1").TextProp
    • this.GetItem("Lib1:Lib1Itp1").IntegerProp
    • this.GetItem("Lib1:Lib1Itp1").ArrayProp[0] & " \" & this.GetItem("Lib1:Lib1Itp1").ArrayProp[1]
  • GetItemExtrinsicSchema
    • this.GetItem("DGNECPlugin_Test:Father").FirstName
    • this.GetItem("DGNECPlugin_Test:Father").FirstName & " \" & this.GetItem("DGNECPlugin_Test:Father").LastName
  • GetItemRelatedExtrinsicSchema
    • this.GetItem("DGNECPlugin_Test:Father").FirstName & " \" & this.GetItem("DGNECPlugin_Test:Father").LastName"
    Remarque : L’expression GetRelatedItem est obsolète. Utilisez plutôt *GetRelatedInstance*.
  • Variable MSTN
    • MSTNvariable.GetLocalTempDirectoryBaseName()
    • MSTNvariable.GetNameForTemporaryFile(String partialPathName, String prefix)
    • MSTNvariable.GetVariable("MS_CELL")
    • MSTNvariable.IsVariableDefinedAndTrue("MS_CELL")
    • MSTNvariable.IsVariableDefinedAndFalse("MS_CELL")
    • MSTNvariable.IsVariableDefined("MS_CELL")
    • MSTNvariable.GetLocalTemporaryDirectory("Bentley")
  • Spécifications fichier de dessin
    • DesignFileSetting.GetMasterUnitName()
    • DesignFileSetting.GetActiveAngle()
    • DesignFileSetting.GetAxisAngle()
    • DesignFileSetting.GetTagIncrement()
    • DesignFileSetting.GetFenceClip()
    • DesignFileSetting.GetFenceOverlap()
    • DesignFileSetting.GetFenceVoid()
    • DesignFileSetting.GetGridLock()
    • DesignFileSetting.GetGridRef()
    • DesignFileSetting.GetIsometricLock()
    • DesignFileSetting.GetGraphicGroup()
    • DesignFileSetting.GetSubUnitName()
    • DesignFileSetting.GetAngleLock()
    • DesignFileSetting.GetAngleTolerance()
    • DesignFileSetting.GetSnapMode()
    • DesignFileSetting.GetPointerColor()
    • DesignFileSetting.GetHiLightColor()
    • DesignFileSetting.GetScaleTolerance()
    • DesignFileSetting.GetGridAspect()
    • DesignFileSetting.GetGridOrientation()
    • DesignFileSetting.GetSnapDivisor()
    • DesignFileSetting.GetSnapAssociation()
    • DesignFileSetting.GetIsoPlane()
    • DesignFileSetting.GetStreamDelta()
    • DesignFileSetting.GetStreamTol()
    • DesignFileSetting.GetStreamAngle()
    • DesignFileSetting.GetStreamArea()
    • DesignFileSetting.GetStreamAcceptance()
    • DesignFileSetting.GetSolidsArea()
    • DesignFileSetting.GetAngleClockwise()
    • DesignFileSetting.GetAngleBase()
    • DesignFileSetting.GetActiveScaleX()
    • DesignFileSetting.GetActiveScaleY()
    • DesignFileSetting.GetAxisLock()
    • DesignFileSetting.GetBackground(1)
    • DesignFileSetting.GetPixelWidth(1)
    • DesignFileSetting.GetPixelHeight(1)
    • DesignFileSetting.GetSelectionSetClr()
    • DesignFileSetting.GetSnapACSPlane()
    • DesignFileSetting.GetACSPlaneLock()
    • DesignFileSetting.GetScaleLock()
    • DesignFileSetting.GetSnapLock()
    • DesignFileSetting.GetLevelLock()
  • Fichier actif
    • ActiveFile.ACSPlaneSnap
    • ActiveFile.ActiveAngle
    • ActiveFile.AngleLock
    • ActiveFile.Association
    • ActiveFile.Author
    • ActiveFile.AuthoringProductName
    • ActiveFile.AxisLock
    • ActiveFile.Client
    • ActiveFile.Comments
    • ActiveFile.ConnectProjectGUID
    • ActiveFile.CreateDate
    • ActiveFile.DesignRevisionCount
    • ActiveFile.DesignRevisions
    • ActiveFile.Editor
    • ActiveFile.FileName
    • ActiveFile.FileSize
    • ActiveFile.Format
    • ActiveFile.FormatMinorVersion
    • ActiveFile.GetClass()
    • ActiveFile.FormatMajorVersion
    • ActiveFile.GetInstanceId()
    • ActiveFile.GetInstanceLabel()
    • ActiveFile.GetRelatedInstance()
    • ActiveFile.Increment
    • ActiveFile.IsOfClass("Room","ExampleSchema.01.00")
    • ActiveFile.KeyPointDevisor
    • ActiveFile.Keywords
    • ActiveFile.LastSavedBy
    • ActiveFile.LevelLock
    • ActiveFile.Levels
    • ActiveFile.LevelsUsed
    • ActiveFile.Manager
    • ActiveFile.Models
    • ActiveFile.Orientation
    • ActiveFile.OriginalFileFormat
    • ActiveFile.Owner
    • ActiveFile.PlotDate
    • ActiveFile.ProjectAssetType
    • ActiveFile.ProjectIndustry
    • ActiveFile.ProjectLocation
    • ActiveFile.ProjectName
    • ActiveFile.ProjectNumber
    • ActiveFile.ProjectStatus
    • ActiveFile.Revision
    • ActiveFile.RevisionNumber
    • ActiveFile.SaveDate
    • ActiveFile.ScaleLock
    • ActiveFile.Sheet_Number
    • ActiveFile.ScaleTolerance
    • ActiveFile.SnapLock
    • ActiveFile.SnapMode
    • ActiveFile.StartAngle
    • ActiveFile.Subject
    • ActiveFile.Title
    • ActiveFile.Tolerance
    • ActiveFile.TotalEditingTime
    • ActiveFile.WorkSetDescription
    • ActiveFile.WorkSetName
    • ActiveFile.WorkSpaceName
    • ActiveFile.XActiveScale
    • ActiveFile.YActiveScale
    • ActiveFile.ZActiveScale
  • Session
    • Session.IsActiveFileInCfgVarList("MS_GUIDGNLIBLIST")
    • Session.IsV7DgnFile()
    • Session.IsDwgFile()
    • Session.IsDxfFile()
    • Session.IsReadOnlyFile()
    • Session.IsBentleyView()
    • Session.ItemBrowserInBentleyView()
    • Session.ActiveTaskType()
    • Session.ActiveWorkflow()
    • Session.AreCustomTasksAvailable()
    • Session.IsCustomTaskAvailable()
    • Session.ActiveCommandKeyin()
    • Session.IsMdlLoaded("PSELECT")
    • Session.EvalNEAsDouble("1+2",3.7)
    • Session.EvalNEAsInt("3+4",9)
    • Session.EvalNEAsBool("false","vrai")
    • Session.EvalNEAsString("a+b","abc")
    • Session.TreatActiveModelAs3D()
    • Session.ActiveModelIsReference()
    • Session.ActiveModelIs3dPrintingModel()
    • Session.ActiveModelIsMarkup()
    • Session.ActiveModelTypeIsDesign()
    • Session.ActiveModelTypeIsSheet()
    • Session.ActiveModelTypeIsDrawing()
    • Session.IsDisplaySetActive()
    • Session.IsNamedToolBoxOpen("Outils supplémentaires")
    • Session.IsToolBoxOpen(-548,"MGDSHOOK")
    • Session.IsToolFrameOpen(-548,"MGDSHOOK")
    • Session.IsMdlDialogOpen()
    • Session.IsViewDisplayed()
    • Session.ActiveAnnotationScale()
    • Session.IsSnapModeValid(2048)
    • Session.ActiveSnapMode()
    • Session.DefaultSnapMode()
    • Session.IsProductLicence(1000,"08.11.00..00")
    • Session.IsAccuSnapEnabled()
    • Session.GetTextElementJustification()
    • Session.SetTextElementJustification()
    • Session.GetSnapModeMenuMark(SnapMode.Keypoint)
    • Session.IsUndoActive()
    • Session.IsRedoActive()
    • Session.UndoCommandString()
    • Session.RedoCommandString()
    • Session.IsContextualTabSetKeyActive()
    • Session.IsUIItemStateEnabled("MyItem.Key",false)
    • Session.IsUIItemStateEnabled("MyItem.Key",false)
    • Session.IsUIItemStateChecked()
    • Session.GetUIItemStateMenuMark("MyItem.Key")
    • Session.IsSheetIndexReadOnly()
    • Session.ActiveAnnotationScaleString()
    • Session.ActiveAcsDescription()
    • Session.ActiveFileAllowsExports()
    • Session.ActiveFileAllowsPrinting()
    • Session.ActiveFileIsScratch()
    • Session.ActiveFileIsAConfiguratedDgnlib()
    • Session.IsTaskNavigationInRibbon()
    • Session.IsLevelManagerAllowed()
  • WorkSet
    • WorkSet.ProjectName
    • WorkSet.ProjectIndustry
    • WorkSet.ProjectNumber
    • WorkSet.ConnectProjectGUID
    • WorkSet.ProjectAssetType
    • WorkSet.ProjectLocation
    • WorkSet.ProjectStatus
    • WorkSet.WorkSetDescription
    • WorkSet.WorkSetName
    • WorkSet.WorkSpaceName
Si vous avez ajouté des propriétés avancées lors de la création d'un espace de travail, comme une date personnalisée ou du texte personnalisé, utilisez l'expression ci-dessous :

Remarque : WorkSet.CustomPropertyName

  • Heure System.Date (pour cela, vous devez créer des propriétés Date1 et Date2 dans le type d'élément)
    • System.DateTime.Now ()
    • System.DateTime.GetYear(System.DateTime.Now())
    • System.DateTime.GetDateOnly(System.DateTime.Now())
    • System.DateTime.GetDayOfYear(System.DateTime.Now())
    • System.DateTime.GetMillisecond(System.DateTime.Now())
    • System.DateTime.GetSecond(System.DateTime.Now())
    • System.DateTime.GetMinute(System.DateTime.Now())
    • System.DateTime.GetHour(System.DateTime.Now())
    • System.DateTime.GetMonth(System.DateTime.Now())
    • System.DateTime.ToLocalTime(System.DateTime.Now())
    • System.DateTime.Compare(this.date1,this.date2)
    • System.DateTime.UtcNow()
    • System.DateTime.Equals(this.date1, this.date2)
    • System.DateTime.SubtractionInDays(this.date1,this.date2)
    • System.DateTime.SubtractionInYears(this.date1,this.date2)
    • System.DateTime.SubtractionInMonths(this.date1,this.date2)
    • System.DateTime.IsLeapYear(System.DateTime.Now())
  • System.Environment
    • System.Environment.CurrentDirectory ()
    • System.Environment.ExpandEnvironmentVariables (name)
    • System.Environment.GetEnvironmentVariable (variable)
    • System.Environment.UserName ()
  • Verrou Actif
    • ActiveLock.AngleLockEnabled()
    • ActiveLock.AnnotationScaleLockEnabled()
    • ActiveLock.AssociationLockEnabled()
    • ActiveLock.ConstructionPlaneLockEnabled()
    • ActiveLock.ConstructionSnapLockEnabled()
    • ActiveLock.GraphicGroupLockEnabled()
    • ActiveLock.GridLockEnabled()
    • ActiveLock.IsomtricLockEnabled()
    • ActiveLock.LevelLockEnabled()
    • ActiveLock.PatternAssociationLockEnabled()
    • ActiveLock.SnapLockEnabled()
    • ActiveLock.TextNodeLockEnabled()
    • ActiveLock.UnitLockEnabled()
    • ActiveLock.ElementTemplateAssociationLockEnabled()
  • Vue active
    • ActiveView.DisplayStyleName()
    • ActiveView.UseCamera()
    • ActiveView.ShowFill()
    • ActiveView.ShowACSTriad()
    • ActiveView.ShowBackground()
    • ActiveView.ShowBoundayDisplay()
    • ActiveView.UseClipBack()
    • ActiveView.UseClipFront()
    • ActiveView.UseClipVolume()
    • ActiveView.ShowConstructionClass()
    • ActiveView.ShowDimensionClass()
    • ActiveView.ShowDataFields()
    • ActiveView.UseDisplaySet()
    • ActiveView.ShowFastCells()
    • ActiveView.ShowFastCurves()
    • ActiveView.ShowGrid()
    • ActiveView.UseLevelOverrides()
    • ActiveView.ShowLineStyles()
    • ActiveView.ShowLineWeight()
    • ActiveView.ShowPatternBumpMaps()
    • ActiveView.UseDefaultLighting()
    • ActiveView.ShowTags()
    • ActiveView.ShowText()
    • ActiveView.ShowTextNodes()
    • ActiveView.ShowTransparency()
    • Modèle actif
      • ActiveModel.Name
      • ActiveModel.Type
      • ActiveModel.IsActive
      • ActiveModel.Is3D
      • ActiveModel.TreatAs3D
      • ActiveModel.CellType
      • ActiveModel.Description
      • ActiveModel.DefaultRefLogical
      • ActiveModel.PropagateAnnotationScale
      • ActiveModel.AnnotationScale
      • ActiveModel.ModelId
      • ActiveModel.Hidden
      • ActiveModel.IsMarkup
      • ActiveModel.CanbePlacedAsCell
      • ActiveModel.IsMaster
      • ActiveModel.UpdateFieldsAutomatically
      • ActiveModel.CanbePlacedAsAnnotationCel
      • ActiveModel.LineStyleScale
      • ActiveModel.Format
      • ActiveModel.MasterUnit
      • ActiveModel.SubUnit
      • ActiveModel.Accuracy
      • ActiveModel.MasterUnitLabel
      • ActiveModel.SubUnitLabel
      • ActiveModel.GlobalLineStyleScaleFactor
      • ActiveModel.DesignScale
      • ActiveModel.PaperScale
      • ActiveModel.AngleReadoutFormat
      • ActiveModel.AngleReadoutAccuracy
      • ActiveModel.DirectionMode
      • ActiveModel.DirectionBase
      • ActiveModel.Direction
      • ActiveModel.GridLock
      • ActiveModel.GridMaster
      • ActiveModel.GridReference
      • ActiveModel.GridConfig
      • ActiveModel.GridAspect
      • ActiveModel.IsometricLock
      • ActiveModel.IsometricPlane
      • ActiveModel.ACSPlane
      • ActiveModel.Resolution
      • ActiveModel.WorkingArea
      • ActiveModel.SolidArea
      • ActiveModel.SolidAccuracy
    • ActiveView.UsesClipVolumeElement()
  • Point d'origine globale
    • Coordinates.GlobalOrigin.GetX(this.GetElement().Origin)
    • Coordinates.GlobalOrigin.GetY(this.GetElement().Origin)
    • Coordinates.GlobalOrigin.Getz(this.GetElement().Origin)
    • Coordinates.GlobalOrigin.GetGlobalOrigin()

Cette expression permet de définir et de rediriger les coordonnées de l'origine globale dans le fichier de dessin. L'origine du fichier de dessin par défaut affiche les valeurs par défaut.

  • Expressions SCG
    • GCS.GetLatitude(Point SelectedElement)
    • GCS.GetLongitude(Point SelectedElement)
    • GCS.GetElevation(Point SelectedElement)

Vous pouvez définir une propriété de type d'élément à l'aide de l'une des expressions SCG du champ Expression ou à l'aide du Générateur d'expressions.