31
Join the conversation: #AU2015 #FabForum Fabrication: Advanced Scripting Tim Catalano, Jubel Beren, & Scott Pittman RK BIM Technology Coordinators & Construction Manager [email protected] 58.21

Fabrication: Advanced Scripting

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Fabrication: Advanced Scripting

Tim Catalano, Jubel Beren, & Scott PittmanRK BIM Technology Coordinators & Construction Manager

[email protected]

58.21

Page 2: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

In this class we’re going to get into some of the more

advanced scripting techniques that you may not be

aware of but will likely be useful in your workflows. We’ll

start by setting up Notepad++ to work with script files,

then we’ll dive into a script that covers a number of

advanced workflows, including using lisp to create a

command in AutoCAD

Class summary

57.31

Page 3: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

At the end of this class, you will be able to:

Setup and work with Notepad++ for scripting

Write an advanced script that makes use of multiple techniques including

Access exported data not directly available to scripts

Use undocumented features such as Task

Read external data into a script

Open and wait for a custom written html report from scripting

Write a command in Lisp that exports data and then executes a script

Key learning objectives

56.42

Page 4: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Notepad++

55.52

Page 5: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Notepad++

Open Notepad++The icon should look like this

<Class Folder Directory>\MSF9703-L - Fabrication Advanced Scripting\cod.xml

When you’re done, close and reopen notepad++ to ensure cod is usable54.63

Page 6: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Keywords Lists

1st group is language keywords Like And, If, Function, etc…

2nd group is properties

3rd group is functions

4th group is objects and

constants

5th group is variables

8th group is error help Like if you put Item.CIDD on accident,

it will show up red

Also helps identify things that need to

be added to the language definition

Notepad++

52.84

Page 7: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1Size and Service Abbreviation to Alias Text

51.94

Page 8: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Open CADmepThe “F” icon with CME

<Class Folder Directory>\MSF9703-L - Fabrication Advanced Scripting\Exercise 01\

In CADmep open the dwg file: SizeAndServiceToAliasText_Tester.dwg

50.15

Page 9: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

49.25

CSVExport

Page 10: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

48.36

Page 11: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

47.46

Page 12: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

45.67

Page 13: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

New DocumentToolbar icon, File/New, or Ctrl+N

<Class Folder Directory>\MSF9703-L - Fabrication Advanced Scripting\Exercise 01\Completed\

SizeAndServiceToAliasText.cod Open for reference or to Copy/Paste from44.78

Page 14: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Variables40.30

Page 15: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Function: GetAbv

[SvcI] Services Abvs

1 1 Hydro… 1 CWR

2 2 Plumb… 2 V

35.82

Page 16: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Function: AddHtmlAdditional information about writing html:

31.34

Page 17: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Function: DoWork26.87

Page 18: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Process: Read ServiceABV.csv

Change this to the path of your actual desktop, ex.: C:\Users\<UserName>\Desktop

1

Pos = 40

Len = 43

22.39

Page 19: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Process: Selection Loop17.91

Page 20: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Output

One Line

Change this to the path of your actual desktop, ex.: C:\Users\<UserName>\Desktop

13.43

Page 21: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Save your Script

<Desktop>\SizeAndServiceToAliasText.codEx.: C:\Users\<UserName>\Desktop\SizeAndServiceToAliasText.cod

12.54

Page 22: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Create a New FileToolbar icon, File/New, or Ctrl+N

Open Visual Lisp IDECommand: VLISP

Open Fabrication CADmepThe “F” icon with CME

11.64

Page 23: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Output

123

Change

\ to /Backslash to Forward Slash

In Paths copied in from explorer

7.16

Page 24: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Execute: AutoCAD

<Class Folder Directory>\MSF9703-L - Fabrication Advanced Scripting\Exercise 01\

SizeAndServiceToAliasText_Tester.dwg

6.27

Page 25: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Results5.37

Page 26: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Debugging

• Verify all spelling, look for red code as the first step.

• Did you miss a Then on an If statement?

• Verify you changed <Desktop> to your actual desktop path• Ex.: C:\Users\<UserName>\Desktop\

• Every instance in your script as well as the path in your lisp file

• All parenthesis, square brackets, and quotes closed?

• If all else fails, Copy/Paste from the completed code.

0.90

Page 27: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Exercise 1 | Size and Service Abbreviation to Alias Text

Results0.00

Page 28: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Page 29: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Via the Survey Stations, email or mobile device.

AU 2016 passes awarded daily!

Give your feedback after

each session.

Give instructors feedback

in real-time.

Be heard! Provide AU session feedback.

#AU2015

Page 30: Fabrication: Advanced Scripting

Join the conversation: #AU2015 #FabForum

Too many sessions, too little time?

After AU visit:

AutodeskUniversity.com

Recorded sessions

Presentations and handouts

Key learnings

Don’t miss a second! Find hundreds

of sessions waiting for you.

#AU2015

Page 31: Fabrication: Advanced Scripting

Autodesk is a registered trademark of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not

responsible for typographical or graphical errors that may appear in this document. © 2015 Autodesk, Inc. All rights reserved.