works from ide, not from lisp macro

Discussion in 'AutoCAD' started by Mark Propst, Sep 18, 2003.

  1. Mark Propst

    Mark Propst Guest

    Hi all you VB master dudes and dudettes!

    I'm trying to set up a plot routine from vb.
    it works perfect run from the ide with f5
    but from a lisp macro it errs on this line with error "Invalid input."
    Why would it be invalid from a macro but not from the ide?

    the line that errs:

    ..StyleSheet = "H:\atr\2002\plotstyles\atr.ctb"
    or
    ..StyleSheet = "atr.ctb" (since it's on the path)
    either one give invalid input

    the whole plot function:
    Sub PlotCurrentTab2436T() 'plot current tab 24x36 to 11x17 (tabloid)
    Dim lyt As ACADLayout
    Dim pConfig As AcadPlotConfiguration
    Set pConfig = ThisDrawing.PlotConfigurations("ATR24x36T")
    With ThisDrawing
    .Plot.NumberOfCopies = 1
    Set lyt = .ActiveLayout
    With lyt
    If .Name <> "Model" Then
    .CopyFrom pConfig
    .PlotWithPlotStyles = True
    .StyleSheet = "H:\atr\2002\plotstyles\atr.ctb"
    .RefreshPlotDeviceInfo
    .Plot.PlotToDevice "H:\atr\2002\plotters\ATR11x17.pc3"
    End If
    End With
    End With
    Set pConfig = Nothing
    End Sub

    the macro that runs the sub:
    (DEFUN Print-2436TVB()
    (macro "PlotFuncsprj.dvb" "PlotFuncsMod" "PlotCurrentTab2436t")
    )

    (defun macro(dvbFile modName subName / vbfile)
    (if(/=(strcase (substr dvbFile (-(strlen dvbfile)3)))".DVB")
    (setq dvbFile (strcat dvbfile ".dvb")))
    (if (setq vbFile(findfile dvbFile)) ;if the project file is found
    (progn
    (vl-vbaload VBFILE) ;load the project file
    (vl-vbarun (strcat modname "." subName)) ;run the project macro
    ) ;progn
    (princ (strcat"\nFile not found: " dvbfile)) ;if project not found, inform
    the user
    ) ;if
    (princ)
    ) ;defun

    the menu button that calls the macro:
    ID_PrintCur1117vb [_Button("Print CurTab 11x17 VB", "PrinterVB.bmp",
    "Printervb.bmp")]^C^C^P(Print-2436TVB)

    any one see anything stupidly obvious?
    Tia
    Mark
     
    Mark Propst, Sep 18, 2003
    #1
  2. Mark Propst

    Mark Propst Guest

    sorry, I'm wrong it's not working from the ide today either!
    it was yesterday but ???
     
    Mark Propst, Sep 18, 2003
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.