$dgn=$objustn.OpenDesignFile('C:\x.dgn') $objustn.CadInputQueue.SendKeyin('fit all') $objustn.CadInputQueue.SendDataPoint <<variablePoint3d>> #void SendDataPoint (Point3d, Variant, int)
how to declare a Point3d variable named "VariablePoint3d" and assign x,y,z values to this in PowerShell.
How are you creating the $objustn variable?
if after creating the variable you do:
Get-Member -InputObject $objustn
what does it list as the properties and methods?
Hi Kevin,
Kevin van Haaren said:How are you creating the $objustn variable?
$objustn = new-Object -ComObject MicroStationDGN.Application
Kevin van Haaren said:Get-Member -InputObject $objustn
Type: Point3d -------- Method: Point3dFromXY (double, double)
Type: Point3d -------- Method: Point3dFromXYZ (double, double, double)
i tried with below code; But, still no luck.
[double]$var0 = 100.0 [double]$var1 = 100.0 [double]$var2 = 100.0 [Point3d]$pt=$objustn.Point3dFromXYZ($var0,$var1,$var2) ##ERROR The specified record cannot be mapped to a managed value class. At line:1 char:1 + [Point3d]$pt=$objustn.Point3dFromXYZ($var0,$var1,$var2) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], ArgumentException + FullyQualifiedErrorId : System.ArgumentException
Vinoth Joseph
ATKINS
Bangalore, India
The workaround of $objustn.CadInputQueue.SendDataPoint ($objustn.Point3dFromXY(1,2)) is
$objustn.CadInputQueue.SendKeyin ('XY=1,2')
Yes Yongan, its working fine from key-in commands.