MicroGDS @ \ Ɠ.

Windows PowerShell ɂ u I u W F N g ̈ꗗ \ v T v

Windows ̐V R } h. уI u W F N g 擾 J X ^ } C.Y.T. .

Windows PowerShell ɂ
u.I.u.W.F.N.g...̈ꗗ.\..v.T...v...s.C.

 


ł ́A ] ̃J X ^ } C Y @ ł Cadlink C u icadlnk60.dll A.NET C u imgdsnet.dll j 𗘗p A v P [ V Ƃ Ă Љ

Windows PowerShell 1.0 MicroGDS 10.0 .NET C u g ăJ X ^ } C Y ꍇ ́A Microsoft .NET Framework 2.0 C X g [ Ă K v

p r

w t @ C ̗D E B h E u W F N g ̂ 擾

ӓ_

Windows PowerShell ̓Z L e B ̗ R A f. C ̎ s ɂȂ Ă ͂ B ȉ ̎ 菇 Ŏ s | V [ ύX Ă B

  1. X ^ [ g j [ Windows PowerShell s ͂ B
  2. N Windows PowerShell ̃E B h E ŁA s | V [ RemoteSigned ɐzyme 肵.
    Set-ExecutionPolicy RemoteSigned

Remote Signed ̓ C ^ [ l b g o R Ń_ E [. v ̃ I v V ɂ Restricted i ׂẴX N v g s Ȃ j A All Signed i ׂẴX N v g ɏؖ v. v g s ?? A C ^ [ l b g o R Ń_ E R [ h ͎ s m F erected ̂ j

g

  1. Windows PowerShell ̃E B h E ŃX N v g t @ C s
    C:\script\Get-Ocd-List.ps1
  2. MicroGDS N Ă Ȃ ꍇ ́A MicroGDS N A T v MAN t @ C ɑ ase I u W F N g ̂ \ Ă MicroGDS I ͂ B MicroGDS N Ă ꍇ ́A t @ C ̂ \ A MicroGDS I Ƀt @ C polished ̂ ??

j uC: \ script v t H _ ɃX N v g t @ C ۑ

  1. G N X v [ g āA _ 쐬
  2. X ^ [ g j [ 烁 N
  3. ̕ Ƀ \ [ X ͂ ̂ i R s [ ^ y [ X g B
  4. t @ C uC: \ script \ Get-Ocd-List.ps1 v Ƃ ĕۑ
  5. I
\ [ X
  1. g p ϐ ̐ 錾 A s Ȃ ̂ B MicroGDS 10.0 ̃C X g Ă ꍇ ́ADll уT v MAN t @ C ̃p X ύX Ă B
  2. Windows PowerShell MicroGDS . NET C u g p ł 悤 Ƀ [ h
  3. MicroGDS ̋N 擾 N Ă Ȃ ꍇ Micro GDS ɋN Ă ꍇ ́A MicroGDS ̃Z b V 擾 ė p ͂ B
  4. MicroGDS ƒʐM J n
  5. t @ C J A Ƀ I u W N g B MicroGDS N ꍇ @ C ?? ͂ Micro GDS I ͂ B
  6. MicroGDS لʐM ؒf ͂ B

T v \ [ X

### Windows PowerShell���g����MicroGDS�̃J�X�^�}�C�Y��

# �ϐ��̐錾
[string]$TarDllFile = "C:\Program Files\Informatix\MicroGDS 10.0\Custom\MGDSNet.dll";
[string]$TarManFile = "C:\Program Files\Informatix\MicroGDS 10.0\Sample Drawings\Office.man";
[int]$mg_timeout = 100000
[int]$RetVal = 0
[int]$bStat = 0
[bool]$IsBoot = $false

# MGDSNet.dll�����[�h����
[void][Reflection.Assembly]::LoadFile($TarDllFile)

# MicroGDS�̋N�������擾
$RetVal = [Informatix.MGDS.Cad]::GetSessionCount()
if ($RetVal -lt 1)
{
   # MicroGDS���N������
   $sid = [Informatix.MGDS.Cad]::StartMicroGDS(
      [Informatix.MGDS.StartFileType]::MAN, $mg_timeout)
   $IsBoot = $true
}
else
{
   # ������MicroGDS�𗘗p����
   [int[]]$sessionId = 0
   $RetVal = [Informatix.MGDS.Cad]::GetSessionIDs($sessionId, 1);
   if ($RetVal -eq 0)
   {
      Write-Output "... �������”\��MicroGDS������܂���B"
      return
   }
   $sid = $sessionId[0]
}

# MicroGDS�ƒʐM�J�n
$mg_cv = New-Object Informatix.MGDS.Conversation
[void]$mg_cv.Start($sid, $mg_timeout)

# �t�@�C�����J��
$RetVal = [Informatix.MGDS.Cad]::OpenMANFile($TarManFile, $true)

# �I�u�W�F�N�g�̏����擾
for($bStat = [Informatix.MGDS.Cad]::ObjectScan("H");
   $bStat -eq 1; $bStat = [Informatix.MGDS.Cad]::ObjectNext())
{
   $objname = ""
   [Informatix.MGDS.Cad]::GetCurObjName([ref]$objname)
   Write-Output "... $objname"
}

# �t�@�C����‚���
$bArg = [Informatix.MGDS.Save]::DoNotSave
if ($IsBoot -eq $true)
{
   $RetVal = [Informatix.MGDS.Cad]::Exit($bArg, $bArg)
}
else
{
   $RetVal = [Informatix.MGDS.Cad]::CloseFile($bArg)
}

# MicroGDS�ƒʐM�ؒf
[void]$mg_cv.Stop