CAD/CAM discussion forum > CAD > CopyObjects method crushes zwcad

CopyObjects method crushes zwcad

    
  Subscribe Topic

Rank: 1

beltasar9468

Newbie

posts: 5

Registered: 2016-4-18

Message 1 of 5

 CopyObjects method crushes zwcad
12-12-2016 07:13 . pm   |   View his/her posts only
Hello. I'm using ZWCAD Professional 2008 vernum 2008.07.18(6248) and I can't get official help because they said they stop supporting zwcad2008 (which is just unfair because newer version isn't compatible with my project.zvb file so I can't switch to new version).
My problem is when I use method Document.CopyObjects(pSelectionset As ZwcadSelectionSet, [pDispatch As Object]) As ZwcadSelectionSet it crushes zwcad whenever I'm closing that document where objects were copied from.
At first I was trying to fix my macro assuming there is problem within it. But then I found same macro in developer help in zwcad. It's called Sub Ch4_Copy_to_New_Drawing() in Copy multiple objects section. And it has same problem. It creates 2 circles in DOC0 and copies them to DOC1. It works just fine until I try to close DOC0 where crush occurs.

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 321

Registered: 2015-6-9

Message 2 of 5

13-12-2016 04:27 . pm   |   View his/her posts only
Reply 1# beltasar9468


Hi,
We reproduced the situation according to your description. We will report it to R&D to check. Before it is fixed, you can download ZWCAD Classic to operate this, and I checked it in ZWCAD Classic version and it worked well with the example in help document.

Rank: 1

beltasar9468

Newbie

posts: 5

Registered: 2016-4-18

Message 3 of 5

15-12-2016 09:17 . pm   |   View his/her posts only
Thank you for answering. I'll try ZWCAD Classic.
Could you please also ask them to make new ZWCAD compatible with old .zvb files, so I can switch to new version without recreating all forms that I made.

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 321

Registered: 2015-6-9

Message 4 of 5

16-12-2016 05:13 . pm   |   View his/her posts only
Reply 3# beltasar9468

ZWCAD Classic's vba file is in zvb format, so there is no need to modify anything to load the form in it. As for ZWCAD 2017, the vba file is in zvb format also, but some grammers are changed, so users in ZWCAD Classic or 2012 before will need to make some edit works in their programs.

How to Transplant Programs from ZWCAD Classic or 2012 before to ZWCAD 2017:

Specific procedures are listed as follows:

  • Copy all codes in Thisdrawing from ZWCAD Classic or 2012 before to ZWCAD 2017.

    Tips: If your VBA contains Classes, modules or forms, please export it then import to ZWCAD 2017.

  • Change the symbol Thisdocument to Thisdrawing
  • Change entities type from ZwcadXXX to ZcadXXX, for example, ZwcadLayer→ZcadLayer, IZwcadLWPolyline→IZcadLWPolyline.
  • Following properties are no longer supported:
    • ZVector
    • Parent
  • Following methods are no longer supported:
    • ListSDS
    • LoadLISP
    • LoadSdS
    • UnLoadSDS
    • Justification
    • WildCardMatch
    • PaintLine
    • RunCommand
    • SaveAll
  • The usage of following properties and methods are changed:
    • Thisdrawing.regen should run with parameter.
    • PlotToDevice should run with parameter.
    • ThisDrawing.ActiveViewport.ZoomAll should be changed to ZoomAll.
    • Now the return value of getattributes is an array. It means you should access its value by var(0), rather than var.item(0).
    • Codes like these:
      Dim color As ZwcadAcCmColor
      Set color = Library.CreateTrueColor

      Should be modified to
      Dim color As ZcadZcCmColor
      Set color = ZcadApplication.GetInterfaceObject("ZWCAD.ZcCmColor")
    • Codes like these:
      Dim patterntype As zcHatchType
      Should be modified to
      Dim patterntype As Long

Rank: 1

beltasar9468

Newbie

posts: 5

Registered: 2016-4-18

Message 5 of 5

22-12-2016 05:06 . pm   |   View his/her posts only
That is great news. Thanks. I'll definitely try ZWCAD 2017 then.
See also
X