+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
  1. #1
    Forum Newbie
    Computer Details
    Taurenis's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core i7-2600
    RAM:
    8 GB
    Graphics:
    AMD Radeon HD 6700 Series; 1GB
    Monitor:
    Samsung SyncMaster 226BW
    Using
    AutoCAD 2014
    Join Date
    Sep 2014
    Location
    Latvia
    Posts
    8

    Default Read information from drawing and use it in a command string

    Registered forum members do not see this ad.

    Dear CAD specialists,

    is there a way to read information from drawing (e.g. content of a specific text object, content/value of specific attribute or any other object that I can place in a layout) and then put that information in a command string?

    LISP is not in the range of solutions as:
    1) I haven't had time to dig into it
    2) I have quite a few LT users who also need to be able to use my solution

    Simple example of the problem
    I have an object with a value "5". I would like to draw a polyline with a width equal to that object's value ("5") using a Tool with a command string:
    ^C^C_PLINE;\width;[read object's value];[read object's value];

    The real problem
    I have created PageSetups for different paper sizes for our plotter as well as for creating PDF and plt files. PageSetups include custom paper sizes.
    To simplify plotting I have created tools for each paper size with a command string e.g.:
    for plotter: ^C^Cpreview;-plot;N;;_A3_HP500;HP500_A3_A3.2_A3.1_A3.0.pc3;N;N;
    for pdf file: ^C^Cpreview;-plot;N;;_A3_DWG to PDF;CP_DWG To PDF.pc3;~;N;y;

    Explanation
    ^C^C: cancels all the previous commands
    preview: leads to print preview so the person can check if drawing is OK
    -plot: invokes plotting
    N: is the answer to question whether detailed plot configuration is necessary
    [empty]: uses default (actice) layout name for layout to be plotted
    _A3_HP500: is the name of PageSetup
    HP500_A3_A3.2_A3.1_A3.0.pc3: is the name of output device
    N: is the answer to question whether to write the plot to a file
    N; is the answer to question whether to save changes to PageSetup
    The last question which is answered manually is whether to proceed with plot

    What I would like to do is create a tool which reads the PageSetup name and output device name from something that I can define along with (or within) a layout. Each layout would contain 6 source objects/fields (plotter/pdf/plt x PageSetup/name of output device). This way I could use one tool for plotting, one for creating pdf file and one for creating plt file disregarding the current paper size

    The command string would look smt like:
    ^C^Cpreview;-plot;N;;[value from drawing A1];[value from drawing B1];N;N;

  2. #2
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2017
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,043

    Default

    Interesting idea, if you create a plot style, surely you can set the plotter/pdf/plt in the style, so the output device would just accept the default during the -plot command. You could then run a macro that would ask for which option you want "output to plotter", "output to PDF" or "output to plt". Though it might be easier to just have 3 macro's to choose from.

  3. #3
    Forum Newbie
    Computer Details
    Taurenis's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core i7-2600
    RAM:
    8 GB
    Graphics:
    AMD Radeon HD 6700 Series; 1GB
    Monitor:
    Samsung SyncMaster 226BW
    Using
    AutoCAD 2014
    Join Date
    Sep 2014
    Location
    Latvia
    Posts
    8

    Default

    Thanks for the answer.
    I believe that by writing "plot style" you mean PageSetup.
    However, the thing is that for the specific layout (say paper size A3.2) I have three PageSetups - one for plotting, one for PDF and one for plt. If I go with all the default values of -plot command it will use the PageSetup which is set as current. So it doesn't solve the problem.

  4. #4
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2017
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,043

    Default

    Sorry yes I meant PaseSetup, if you have a PageSetup for each of the 3 options and but that in you your macro then the next prompt for the plottername actually uses this as the default value and not the one stored with the layout, so if your layout is set up with PageSetup "plotter" but your macro uses PageSetup "PDF" then "PDF" is the default value used there is no need to give the device again, it just cuts out one hurdle from your question.

  5. #5
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2017
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,043

    Default

    The next question is, are you then only wanting the user to make the choice of device because if it is set per layout then all you need do is call the -plot command. Sorry if I'm missing the point I'm just trying to clarify the question in my own mind I can be a bit slow sometimes

  6. #6
    Forum Newbie
    Computer Details
    Taurenis's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core i7-2600
    RAM:
    8 GB
    Graphics:
    AMD Radeon HD 6700 Series; 1GB
    Monitor:
    Samsung SyncMaster 226BW
    Using
    AutoCAD 2014
    Join Date
    Sep 2014
    Location
    Latvia
    Posts
    8

    Default

    I would like to create a solution where the user doesn't have to make any choices but which button to press - "Plot" / "Create PDF" / "Create PLT".
    If I get you correctly then I already have the solution you are suggesting - I have three buttons for each paper size. However, each paper size needs to have a PageSetups for "Plot" / "Create PDF" / "Create PLT". It means that I have 3x the number of paper sizes (in my case 3x28=84) buttons.
    What I want is to have 3 buttons which "understand" which paper size is now active and chooses appropriate PageSetup.

  7. #7
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2017
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,043

    Default

    Sorry again, but why do you need to change paper size. If a layout is setup on A4 with all its titles and viewports, and you plot it ontoi A3 you get an A4 drawing in the middle of the sheet; From the other side if it is A3 and you print to A4 using PlotSetup then you only get half a drawing, on the other hand if you are wanting to plot a drawing layout of A3 onto a smaller A4 sheet, then you need to answer yes to the first prompt and go into the detailed plot configuration settings (I think that was confusing me), if so then the problem needs rethinking.
    So if the size of paper is being input into an attribute by someone that is a fixed value for that layout, why not just change the default PageSetup for that layout. Otherwise the paper size needs to be decided as you are running the macro and doesn't need storing in the drawing, which is a different approach to how the macro would work.

    If the layout is drawn and you would like the user to have the option to plot at A4, A3 A1 etc onto paper, pdf or file then the user needs to change something like an attribute first, before the macro is run, correct?

  8. #8
    Forum Newbie
    Computer Details
    Taurenis's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core i7-2600
    RAM:
    8 GB
    Graphics:
    AMD Radeon HD 6700 Series; 1GB
    Monitor:
    Samsung SyncMaster 226BW
    Using
    AutoCAD 2014
    Join Date
    Sep 2014
    Location
    Latvia
    Posts
    8

    Default

    Hmm.. we are not on the same page on this one.
    No need to change the paper size in the way you described. I beleve that the problem might be hiding in the way we are used to work with drawing files.

    I will give an example. Hope this will straight the things out.

    Lets say I have two drawings in a file. Each is put on a separate layout (imported from a template) - one is A3.1 (paper size A3.1) the other is A2.0 (paper size A2.0). A3.1 has three PageSetups corresponding to it ("A3.1 plotter"/"A3.1 PDF"/"A3.1 PLT"). Analogically for A2.0.
    1st I want to create PDF file. 2nd I want to plot from dwg.

    1.1) I activate layout A3.1. If I have 3 buttons (plot/create pdf/create plt) I hit "create pdf"; the command string now has to understand that it has to use PageSetup "A3.1 PDF".
    1.2) I activate layout A2.0. If I have 3 buttons (plot/create pdf/create plt) I hit "create pdf"; the command string now has to understand that it has to use PageSetup "A2.0 PDF".
    2.1) I activate layout A3.1. If I have 3 buttons (plot/create pdf/create plt) I hit "plot"; the command string now has to understand that it has to use PageSetup "A3.1 plotter".
    2.2) I activate layout A2.0. If I have 3 buttons (plot/create pdf/create plt) I hit "plot"; the command string now has to understand that it has to use PageSetup "A2.0 plotter".

  9. #9
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2017
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,043

    Default

    So what is different in the PageSetup for Plotter or PDF, if the paper is constant A3 for a particular layout the only thing that changes is the output device. You still need to have dozens of PageSetup's to apply to various layouts for paper size but each layout can only ever have a choice of 3 output devices (the PageSetup for that layout is fixed), however that layout is set at A3 so you only need choose the output device.
    I'm not being deliberately argumentative, the problem I have is that at work we use network printers and getting the -plot command to recognise the name is difficult, if it is setup in a PageSetup then the problem goes away because that is the default value, but if you need to use the plotter name in the macro it causes issues, really all I need to know is how you would like the user to decide on the output device. It can be stored in a variable that is read by a macro, but if it is already saved in a PageSetup life is so much easier.
    If each layout is setup for the plotter the macro only has to choose "yes" default or change to pdf or plt.

  10. #10
    Forum Newbie
    Computer Details
    Taurenis's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core i7-2600
    RAM:
    8 GB
    Graphics:
    AMD Radeon HD 6700 Series; 1GB
    Monitor:
    Samsung SyncMaster 226BW
    Using
    AutoCAD 2014
    Join Date
    Sep 2014
    Location
    Latvia
    Posts
    8

    Default

    Registered forum members do not see this ad.

    Ok. I totally got where we were not connecting.
    The thing is that our plotter is a bit old and has a "character".
    1) In order to be able to print with correct margins, I had to create a custom paper size with a custom margins and define custom offsets in PageSetup (PS). So plotter is actually using a different paper from the one built-in ACAD PDF creator uses even though the outcome is the same.
    2) For our plotter I can only save 5 custom paper sizes per pc3 file. So I created a pc3 file for A3+*A3.2+A3.1+A3.0, A2+A2.1+A2.0 and A1+A1.0 (so it's three pc3 files/plotting devices for ISO paper sizes).

    So the question is still open - how can I fill in the missing info in command string:
    ^C^Cpreview;-plot;N;;[value from drawing A1];[value from drawing B1];N;N;

    *A3.1, A2.0 etc. are the prolonged standart ISO paper sizes (see the image http://imgur.com/7V8d4yV).

Similar Threads

  1. Replies: 6
    Last Post: 17th Mar 2012, 02:32 pm
  2. Replies: 5
    Last Post: 25th Jan 2011, 06:49 am
  3. LISP: Read a character from string?
    By Olhado_ in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 24th Jan 2010, 09:42 am
  4. Tool Palette Command String
    By neekcotrack in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 5th Aug 2008, 04:46 pm
  5. Adding a String to the Text Command
    By muppetfan88 in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 29th Apr 2006, 03:49 am

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts