$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.
Not sure what the input needs to be but you could record a macro doing what you need and convert to VBA. That will give you the code you need.
Also, "false" is spelt incorrectly in your code sample.
Regards
Chris
AECOM Roads UK&I Digital Engineering, Design & Solutions Lead | Sector Information Management Lead
Associate Director – Digital
OpenRoads Designer 10.12 | MicroStation 2023 | ProjectWise CE 10.3.4 | ContextCapture | ProjectWise PowerShell 2023 | ProjectWise WSG API | Generative Components | OpenBridge Designer 10.12
Civil 3D 2023 | Dynamo | Navisworks Manage
PowerShell | Visual Studio | Office 365 | Power Platform | Teams | SharePoint | Visio
Speckle | BIMVision | Revizto | Solibri
Thank you Chris.
Vinoth Joseph
ATKINS
Bangalore, India
Vinoth Joseph,
This question should have been posted in one of the MicroStation forums. PWPS_DAB has very limited functionality with MicroStation.
Hi Dan, I'm not sure how to move this post to Microstation forums. Any lead please.
I will look into getting this moved. It isn't a "problem", but obviously more MicroStation savvy folks would see posts like this and then more likely one or more responses.
Thanks, Dan.
Hi Vinoth,
Vinoth Joseph said:I'm not sure how to move this post to Microstation forums. Any lead please.
use More > Move tool available under your original post.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan, I moved this question to Microstation Forum.
Thanks,
Vinoth
Vinoth Joseph said:declare a Point3d variable named "VariablePoint3d" and assign x,y,z values to this in PowerShell
Try something like this...
$objustn.CadInputQueue.SendDataPoint ($objustn.Point3dFromXY(1,2))
Regards, Jon Summers LA Solutions
Thanks, Jon.
I tried as you suggested. but it throws an error.
$objustn.CadInputQueue.SendDataPoint($objustn.Point3dFromXYZ(0,0,0)) The specified record cannot be mapped to a managed value class. At line:1 char:1 + $objustn.CadInputQueue.SendDataPoint($objustn.Point3dFromXYZ(0,0,0)) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], ArgumentException + FullyQualifiedErrorId : System.ArgumentException