Site Logo
Site Logo
 
It is currently Sun Apr 02, 2017 7:02 pm

All times are UTC [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: import a file ( dgk or other )
PostPosted: Fri Sep 16, 2016 5:21 pm 
Offline
DELCAM Guru
DELCAM Guru

Joined: Tue Nov 07, 2006 1:16 pm
Posts: 75
hi,
I can't import a file !

I've a dgk file in "H:\samples.dgk"

how can i do ?

Thank's


Top
 Profile  
 
 Post subject: Re: import a file ( dgk or other )
PostPosted: Fri Sep 16, 2016 5:27 pm 
Offline
DELCAM Staff
DELCAM Staff

Joined: Tue Mar 17, 2009 2:30 pm
Posts: 108
Simply use the Import function on the ActiveModel.


Top
 Profile  
 
 Post subject: Re: import a file ( dgk or other )
PostPosted: Fri Sep 16, 2016 8:00 pm 
Offline
DELCAM Guru
DELCAM Guru

Joined: Tue Nov 07, 2006 1:16 pm
Posts: 75
sorry but i can't do it !

Dim psm As Delcam.ProductInterface.PowerSHAPE.PSModel = ps.ActiveModel
Dim file As Delcam.FileSystem.File

psm.import ( ???? )

Sorry but i'm an self-taught !!


Top
 Profile  
 
 Post subject: Re: import a file ( dgk or other )
PostPosted: Mon Sep 19, 2016 9:16 am 
Offline
DELCAM Staff
DELCAM Staff

Joined: Tue Mar 17, 2009 2:30 pm
Posts: 108
No, problem!

Code:
Dim psm As Delcam.ProductInterface.PowerSHAPE.PSModel = ps.ActiveModel
Dim file As New Delcam.FileSystem.File("C:\whereverYourFileIs.dgk")
Dim importedItems = psm.Import(file)


You will then need to cast the items in importedItems to be the type they actually are. e.g. If you know they are solids then:
Code:
Dim firstSolid = CType(importedItems[0], PSSolid)


Top
 Profile  
 
 Post subject: Re: import a file ( dgk or other )
PostPosted: Mon Sep 19, 2016 1:42 pm 
Offline
DELCAM Guru
DELCAM Guru

Joined: Tue Nov 07, 2006 1:16 pm
Posts: 75
thank's but if i not know the type of the import entities where i do ?

example:
i import 3 entity:
entity 0 = line
entity 1 = line
entity 2 = surface

and i've to do something at the line .... create a circle at start point of each line .......

thank 's


Top
 Profile  
 
 Post subject: Re: import a file ( dgk or other )
PostPosted: Mon Sep 19, 2016 3:07 pm 
Offline
DELCAM Staff
DELCAM Staff

Joined: Tue Mar 17, 2009 2:30 pm
Posts: 108
As you say, you would know the types of the entities so you would just need to determine which is which. You could do this by name or just check their actual types.

Although the typed as PSEntity, due to polymorhpism they are actually PSLine or PSSurface. So something like:
Code:
If GetType(PSLine).IsInstanceOfType(item1) Then
  Dim startPoint = CType(item1, PSLine).StartPoint


Top
 Profile  
 
 Post subject: Re: import a file ( dgk or other )
PostPosted: Mon Sep 19, 2016 5:12 pm 
Offline
DELCAM Guru
DELCAM Guru

Joined: Tue Nov 07, 2006 1:16 pm
Posts: 75
ok,
tank's


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB